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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to