Date: Mon, 14 Sep 2009 20:32:09 +0300 From: Jaakko Heinonen <jh@saunalahti.fi> To: Mel Flynn <mel.flynn+fbsd.current@mailing.thruhere.net> Cc: freebsd-current@freebsd.org, Pawel Jakub Dawidek <pjd@freebsd.org>, Jeff Blank <jfb@mr-happy.com> Subject: Re: 8.0-BETA4 panic: ffs_sync: rofs mod Message-ID: <20090914173208.GA4273@a91-153-125-115.elisa-laajakaista.fi> In-Reply-To: <200909140302.03003.mel.flynn%2Bfbsd.current@mailing.thruhere.net> References: <20090908202553.GA1368@mr-happy.com> <200909090902.34055.mel.flynn%2Bfbsd.current@mailing.thruhere.net> <20090910091329.GA2726@a91-153-125-115.elisa-laajakaista.fi> <200909140302.03003.mel.flynn%2Bfbsd.current@mailing.thruhere.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2009-09-14, Mel Flynn wrote: > > The most obvious problem seems to be that both "ro" and "rw" options are > > allowed to enter to mount point options concurrently. > > Why does mountd(8) call nmount with update? It uses nmount(2) to update NFS exports. > As I read the above, any command line overrides done through > umount/mount will be negated by having mountd running. That's a bit > surprising. Calling nmount() with "update" and "export" string options shouldn't affect to any other options in any way. The problem is that the mount point has both "ro" and "rw" options active before mountd calls nmount(). Because of the "ro" option FFS mount code changes the file system to read-only. The FFS code looks for "ro" string option only when doing mount updates. Here's a workaround patch for the problem. This is by no means a complete fix for nmount(2) problems with negated mount options (i.e. options prefixed with "no"). %%% Index: sys/kern/vfs_mount.c =================================================================== --- sys/kern/vfs_mount.c (revision 197085) +++ sys/kern/vfs_mount.c (working copy) @@ -675,6 +675,19 @@ vfs_donmount(struct thread *td, int fsfl } /* + * XXX: Delete conflicting read-write/read-only string options. + */ + if (fsflags & MNT_RDONLY) { + vfs_deleteopt(optlist, "noro"); + vfs_deleteopt(optlist, "rw"); + has_noro = 0; + has_rw = 0; + } else { + vfs_deleteopt(optlist, "ro"); + vfs_deleteopt(optlist, "norw"); + } + + /* * If "rw" was specified as a mount option, and we * are trying to update a mount-point from "ro" to "rw", * we need a mount option "noro", since in vfs_mergeopts(), %%% -- Jaakko
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090914173208.GA4273>