From owner-freebsd-bugs@FreeBSD.ORG Sat Sep 29 05:50:08 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F056A16A417 for ; Sat, 29 Sep 2007 05:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D410C13C45B for ; Sat, 29 Sep 2007 05:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8T5o8M5058266 for ; Sat, 29 Sep 2007 05:50:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8T5o88M058265; Sat, 29 Sep 2007 05:50:08 GMT (envelope-from gnats) Date: Sat, 29 Sep 2007 05:50:08 GMT Message-Id: <200709290550.l8T5o88M058265@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Eugene Grosbein Cc: Subject: Re: kern/116608: [panic] [patch] [msdosfs] msdosfs fails to check mount options X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugene Grosbein List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2007 05:50:09 -0000 The following reply was made to PR kern/116608; it has been noted by GNATS. From: Eugene Grosbein 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();