Re: mount oddities

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Sun, 12 Dec 2004 00:03:01 +0100
That's actually interesting...

This patch fixes it.

For all I can see, the responsibility for purging the buffer cache
rests with the filesystem implementation, and therefore I would
expect the problem to have existed ever since UFS2 was introduced.

Anyone with a 5.3 box who can check if this is also a problem
there ?

Poul-Henning


Index: ufs/ffs/ffs_vfsops.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vfsops.c,v
retrieving revision 1.262
diff -u -r1.262 ffs_vfsops.c
--- ufs/ffs/ffs_vfsops.c	7 Dec 2004 15:09:30 -0000	1.262
+++ ufs/ffs/ffs_vfsops.c	11 Dec 2004 22:56:42 -0000
_at__at_ -778,6 +778,7 _at__at_
 out:
 	if (bp)
 		brelse(bp);
+	vinvalbuf(devvp, V_SAVE, NOCRED, td, 0, 0);
 	if (cp != NULL) {
 		DROP_GIANT();
 		g_topology_lock();




In message <20041208200553.GB1340_at_ip.net.ua>, Ruslan Ermilov writes:
>
>--ftEhullJWpWg/VHq
>Content-Type: text/plain; charset=us-ascii
>Content-Disposition: inline
>Content-Transfer-Encoding: quoted-printable
>
>Hi Poul-Henning,
>
>I first noticed this oddity with MS-DOS formatted floppies,
>when no matter what floppy I insert into the drive later,
>it's still treated as MS-DOS.
>
>I believe the testcase below is related to the problem I'm
>seeing.
>
>dd if=3D/dev/zero of=3Dimage bs=3D1k count=3D1440
>mdconfig -a -t vnode -f image -u 0
>mount /dev/md0 /mnt
>newfs /dev/md0
>mount /dev/md0 /mnt && umount /mnt
>mdconfig -du0
>mdconfig -a -t vnode -f image -u 0
>mount /dev/md0 /mnt
>umount /mnt
>mdconfig -du0
>
>The second "mount" command should succeed but it doesn't.
>Note that if you remove the first "mount" command, the
>second one succeeds.
>
>
>Cheers,
>--=20
>Ruslan Ermilov
>ru_at_FreeBSD.org
>FreeBSD committer
>
>--ftEhullJWpWg/VHq
>Content-Type: application/pgp-signature
>Content-Disposition: inline
>
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.6 (FreeBSD)
>
>iD8DBQFBt16gqRfpzJluFF4RAh8bAJ0cSjubWcK9lTAkCo03ZG4s/4LJ6gCgmXwA
>aagYDX4qi4RAGiI2i21YCAQ=
>=MzUk
>-----END PGP SIGNATURE-----
>
>--ftEhullJWpWg/VHq--
>

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Sat Dec 11 2004 - 22:03:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:24 UTC