From owner-freebsd-current@FreeBSD.ORG Tue Sep 2 03:42:43 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 979FC16A4BF for ; Tue, 2 Sep 2003 03:42:43 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F1E743FD7 for ; Tue, 2 Sep 2003 03:42:42 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from mail.robbins.dropbear.id.au (210.50.204.225) by smtp01.syd.iprimus.net.au (7.0.018) id 3F4C093C001526BE; Tue, 2 Sep 2003 20:42:40 +1000 Received: by mail.robbins.dropbear.id.au (Postfix, from userid 1000) id B0147C926; Tue, 2 Sep 2003 20:42:39 +1000 (EST) Date: Tue, 2 Sep 2003 20:42:39 +1000 From: Tim Robbins To: Bruce Evans Message-ID: <20030902104239.GA98936@dilbert.robbins.dropbear.id.au> References: <20030901165348.GA542@bsd> <20030902040856.U5166@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030902040856.U5166@gamplex.bde.org> User-Agent: Mutt/1.4.1i cc: Lefteris Chatzibarbas cc: freebsd-current@freebsd.org Subject: Re: Syncer "giving up" on buffers X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 02 Sep 2003 10:42:43 -0000 On Tue, Sep 02, 2003 at 05:10:48AM +1000, Bruce Evans wrote: > Apparently the bug fixed in ext2fs/fs.h revs 1.3, 1.4 and 1.6 (etc.) > was restored in rev.1.14. I think this is because B_LOCKED buffers > were ignored in the sync() in boot() and flushed later when > vfs_unmountall() calls ext2fs_unmount(), but they are now seen in the > sync() so vfs_unmountall() is not called. > > Rev.1.3 of ext2fs/fs.h (etc.) abuses B_LOCKED to do little more than > make the sync() ignore ext2fs's private buffers (its complications are > mainly to handle the resulting B_LOCKED buffers). It wants to brelse() > the buffers so that their BUF_REFCOUNT() is 0 and the sync() in boot() > is happy to handle them. In the original fix, I think the buffers > could be B_DELWRI and then the sync() would fulush them, but setting > B_DELWRI was wrong and was changed (in rev.1.4) to setting the private > flag B_DIRTY instead. Rev.1.13 esssentially removes the brelse() and > adds a new complication (BUF_KERNPROC()) and keeps the old ones. I > think the BUF_KERNPROC() is less than useful -- without the brelse()'s, > the buffers are completely private to the file system. Is there any particular reason why ext2fs keeps these buffers locked instead of reading/writing them in when it needs to, or storing them in malloc'd memory and reading/writing them at mount/unmount time? Do we need to ensure that group descriptors & inode/block bitmaps are not written to disk until the filesystem gets unmounted, or is it merely to improve performance and simplify the code? Tim