From owner-freebsd-current@FreeBSD.ORG Thu Sep 10 09:13:36 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 809CA1065672; Thu, 10 Sep 2009 09:13:36 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 402428FC08; Thu, 10 Sep 2009 09:13:35 +0000 (UTC) Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id 4F6B8139CD2; Thu, 10 Sep 2009 12:13:29 +0300 (EEST) Date: Thu, 10 Sep 2009 12:13:29 +0300 From: Jaakko Heinonen To: Mel Flynn Message-ID: <20090910091329.GA2726@a91-153-125-115.elisa-laajakaista.fi> References: <20090908202553.GA1368@mr-happy.com> <20090908235731.GG1539@garage.freebsd.pl> <20090909005504.GA12660@mr-happy.com> <200909090902.34055.mel.flynn+fbsd.current@mailing.thruhere.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200909090902.34055.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: Thu, 10 Sep 2009 09:13:36 -0000 On 2009-09-09, Mel Flynn wrote: > This problem has also been seen on -questions [1] and I forgot to follow > up after time issues. According to the poster it's easy to reproduce: > - have a mountpoint in /etc/fstab with ro options > - unmount the mountpoint > - remount using -o rw This has been also reported as PR kern/133614. I have tried to reproduce the problem earlier but I didn't succeed until now. Here's how to reproduce it: 1. Have mountd(8) running 2. # mdconfig -a -t vnode -f ufsimg 3. # mount -o ro,rw /dev/md0 /mnt 4. # touch /mnt/foo && sync This is what's going on: Initial nmount() is done with "ro" and "rw" options. The mount point will have "ro", "rw" and "noro" string mount options after nmount(). MNT_RDONLY flag is not set. Then mountd(8) calls nmount() with "update" and "export" string options. This results FFS code to re-mount the file system as read-only because the "ro" string option is active for the mount point. ffs_mount() sets MNT_RDONLY and FFS fs_ronly flags. MNT_RDONLY gets later cleared in vfs_domount() because vfs_export() fails with ENOENT but the fs_ronly flag stays enabled. The most obvious problem seems to be that both "ro" and "rw" options are allowed to enter to mount point options concurrently. I don't have yet a fix to propose. -- Jaakko