From owner-freebsd-fs@FreeBSD.ORG Fri Mar 16 01:58:38 2007 Return-Path: X-Original-To: freebsd-fs@FreeBSD.org Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BFC1916A402; Fri, 16 Mar 2007 01:58:38 +0000 (UTC) (envelope-from david.cecil@nokia.com) Received: from mgw-ext14.nokia.com (smtp.nokia.com [131.228.20.173]) by mx1.freebsd.org (Postfix) with ESMTP id 4AE7413C44B; Fri, 16 Mar 2007 01:58:37 +0000 (UTC) (envelope-from david.cecil@nokia.com) Received: from esebh108.NOE.Nokia.com (esebh108.ntc.nokia.com [172.21.143.145]) by mgw-ext14.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id l2G1wOP2011375; Fri, 16 Mar 2007 03:58:35 +0200 Received: from siebh101.NOE.Nokia.com ([172.30.195.27]) by esebh108.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 16 Mar 2007 03:57:44 +0200 Received: from syebe101.NOE.Nokia.com ([172.30.128.65]) by siebh101.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 16 Mar 2007 09:57:42 +0800 Received: from [172.30.67.240] ([172.30.67.240]) by syebe101.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 16 Mar 2007 12:57:40 +1100 Message-ID: <45F9F994.2050803@nokia.com> Date: Fri, 16 Mar 2007 11:57:40 +1000 From: David Cecil User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: ext Pawel Jakub Dawidek References: <45F776AE.8090702@nokia.com> <20070314161041.GI7847@garage.freebsd.pl> <45F8EE27.6070208@nokia.com> <20070315090031.GB80993@deviant.kiev.zoral.com.ua> <20070315092659.GA14080@garage.freebsd.pl> <45F9C9B4.4030508@nokia.com> <20070315223641.GA89923@xor.obsecurity.org> <45F9CBCC.7050006@nokia.com> <20070316014846.GA3229@garage.freebsd.pl> In-Reply-To: <20070316014846.GA3229@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 Mar 2007 01:57:40.0422 (UTC) FILETIME=[7A986660:01C7676E] X-eXpurgate-Category: 1/0 X-eXpurgate-ID: 149371::070316035835-29CE9BB0-79943A45/0-0/0-1 X-Nokia-AV: Clean Cc: freebsd-fs@FreeBSD.org, ext Kris Kennaway Subject: Re: FFS writes to read-only mount X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2007 01:58:38 -0000 ext Pawel Jakub Dawidek wrote: > On Fri, Mar 16, 2007 at 08:42:20AM +1000, David Cecil wrote: > >>>> It may be that snapshots are used, but not explicitly. The startup scripts attempt to run fsck in the background, which would normally require a snapshot, but shouldn't >>>> for a read-only mount, right? >>>> >>>> >>> What happens if the filesystem is marked dirty, background fsck is >>> enabled, but the filesystem is mounted read-only? >>> >>> >> Yeah, I was wondering the same thing Kris. In fact, that was one of my first suspects when I started looking at this problem. >> >> I had eliminated it because fstat (and ps in ddb) doesn't show fsck running, or the raw device open for writing. Maybe fsck had already closed the descriptor and exited >> but the write to disk (GEOM mirror) is still outstanding in the buffer cache? >> > > Is the offset always the same for this error you're seeing? Maybe some > dirty buffer isn't flushed on disk properly and syncer retries syncing > it every now and then. This would explain why you see it not only early > after system was booted. > Yes, it's the same buffer. What you describe is what I believe I'm seeing. > Could you try disabling bgfsck, by setting background_fsck="NO" to your > /etc/rc.conf? > Yes, I could do that. Again, I'm reluctant to try the experiment before getting as much information as possible from ddb. From the fsck_ffs man page: "To be eligible for background cleaning it must have been running with soft updates, not have been marked as needing a foreground check, and be mounted and writable when the background check is to be done. If these conditions are met, then fsck_ffs exits with a zero exit status. Otherwise it exits with a non-zero exit status. If the file system is clean, it will exit with a non-zero exit status so that the clean status of the file system can be verified and reported during the foreground checks." This says the partition must be writable when the check is done. Now I guess there could be a bug where it's trying to write when it shouldn't... Maybe I should take a look at the fsck_ffs code too. > I know that there is a hack for handling fsck of the root file system. > Bascially once system is mounted read-only (the partition it resides on > is opened read-only), it (the partition) can't be opened for write by > anything else (because of how GEOM works). But there is an exception for > the root partition, which is opened without exclusive bit at first time, > which allows, eg. to boot system into single-user mode and run fsck - > without this hack it won't be possible. So I'm wondering if this can be > problematic if one use bgfsck for the root file system... > I will look into it some more and report back. Thanks, Dave -- Software Engineer Secure and Mobile Connectivity Nokia Enterprise Solutions +61 7 5553 8307 (office) +61 412 728 222 (cell)