kern/116608: [panic] [patch] [msdosfs] msdosfs fails to check mount options

Eugene Grosbein eugen at grosbein.pp.ru
Fri Sep 28 22:50:09 PDT 2007


The following reply was made to PR kern/116608; it has been noted by GNATS.

From: Eugene Grosbein <eugen at grosbein.pp.ru>
To: bug-followup at freebsd.org
Cc:  
Subject: Re: kern/116608: [panic] [patch] [msdosfs] msdosfs fails to check mount options
Date: Sat, 29 Sep 2007 13:45:51 +0800

 Hi!
 
 Trying to minimize effect of change, I've settled with the following
 patch: just ignore "ro" options if there is also "noro" option,
 presumably added within vfs_donmount(). Now it works as expected
 and does not trigger off another bugs :-)
 
 --- sys/fs/msdosfs/msdosfs_vfsops.c.orig	2007-09-24 22:16:52.000000000 +0800
 +++ sys/fs/msdosfs/msdosfs_vfsops.c	2007-09-25 23:48:07.000000000 +0800
 @@ -268,6 +268,7 @@
  				return (EOPNOTSUPP);
  		}
  		if (!(pmp->pm_flags & MSDOSFSMNT_RONLY) &&
 +		    !vfs_flagopt(mp->mnt_optnew, "noro", NULL, 0) &&
  		    vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) {
  			error = VFS_SYNC(mp, MNT_WAIT, td);
  			if (error)
 @@ -314,10 +315,12 @@
  
  			ro_to_rw = 1;
  		}
 +		if(!vfs_flagopt(mp->mnt_optnew, "noro", NULL, 0)) {
  		vfs_flagopt(mp->mnt_optnew, "ro",
  		    &pmp->pm_flags, MSDOSFSMNT_RONLY);
  		vfs_flagopt(mp->mnt_optnew, "ro",
  		    &mp->mnt_flag, MNT_RDONLY);
 +		}
  
  		if (ro_to_rw) {
  			/* Now that the volume is modifiable, mark it dirty. */
 @@ -417,7 +420,7 @@
  	struct g_consumer *cp;
  	struct bufobj *bo;
  
 -	ronly = !vfs_getopt(mp->mnt_optnew, "ro", NULL, NULL);
 +	ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
  	/* XXX: use VOP_ACCESS to check FS perms */
  	DROP_GIANT();
  	g_topology_lock();


More information about the freebsd-bugs mailing list