Date: Sat, 29 Sep 2007 05:50:08 GMT From: Eugene Grosbein <eugen@grosbein.pp.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/116608: [panic] [patch] [msdosfs] msdosfs fails to check mount options Message-ID: <200709290550.l8T5o88M058265@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/116608; it has been noted by GNATS. From: Eugene Grosbein <eugen@grosbein.pp.ru> To: bug-followup@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();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709290550.l8T5o88M058265>