Date: Sun, 13 Oct 2002 18:04:52 +0200 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: "Peter Edwards" <pmedwards@eircom.net> Cc: current@FreeBSD.ORG Subject: Re: Bug unmounting readonly NTFS partitions uncovered by GEOM Message-ID: <6600.1034525092@critter.freebsd.dk> In-Reply-To: Your message of "Sun, 13 Oct 2002 16:50:22 BST." <20021013155228.8D64443E7B@mx1.FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
done. In message <20021013155228.8D64443E7B@mx1.FreeBSD.org>, "Peter Edwards" writes: >ntfs_unmount has had this bug since v 1.1: there's a "ronly" variable that >should be used to detect if the mount is read-only and affect the flags >passed to the VOP_CLOSE of the device vnode accordingly. It's never set to >anything other than zero, but the matching VOP_OPEN in ntfs_mount() gets >it right. > >GEOM notices the mismatch between the VOP_OPEN and VOP_CLOSE on the device, >and panics in g_access_rel() when unmounting a read-only mounted NTFS >partition. > >Does someone want to commit the obvious patch? > > >petere@celery$ cvs -R diff -u sys/fs/ntfs >cvs diff: Diffing sys/fs/ntfs >Index: sys/fs/ntfs/ntfs_vfsops.c >=================================================================== >RCS file: /usr/FreeBSD-CVS/src/sys/fs/ntfs/ntfs_vfsops.c,v >retrieving revision 1.47 >diff -u -r1.47 ntfs_vfsops.c >--- sys/fs/ntfs/ntfs_vfsops.c 27 Sep 2002 18:27:06 -0000 1.47 >+++ sys/fs/ntfs/ntfs_vfsops.c 13 Oct 2002 15:30:01 -0000 >@@ -508,6 +508,7 @@ > > vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, td, 0, 0); > >+ ronly = (mp->mnt_flag & MNT_RDONLY) != 0; > error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, > NOCRED, td); > >-- >Peter Edwards > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-current" in the body of the message > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@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. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6600.1034525092>