From owner-freebsd-current@FreeBSD.ORG Mon Sep 14 17:32:16 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7B471065672; Mon, 14 Sep 2009 17:32:16 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 66C468FC12; Mon, 14 Sep 2009 17:32:16 +0000 (UTC) Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 267432166C7; Mon, 14 Sep 2009 20:32:09 +0300 (EEST) Date: Mon, 14 Sep 2009 20:32:09 +0300 From: Jaakko Heinonen To: Mel Flynn Message-ID: <20090914173208.GA4273@a91-153-125-115.elisa-laajakaista.fi> References: <20090908202553.GA1368@mr-happy.com> <200909090902.34055.mel.flynn+fbsd.current@mailing.thruhere.net> <20090910091329.GA2726@a91-153-125-115.elisa-laajakaista.fi> <200909140302.03003.mel.flynn+fbsd.current@mailing.thruhere.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200909140302.03003.mel.flynn+fbsd.current@mailing.thruhere.net> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: freebsd-current@freebsd.org, Pawel Jakub Dawidek , Jeff Blank Subject: Re: 8.0-BETA4 panic: ffs_sync: rofs mod X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2009 17:32:16 -0000 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