From owner-freebsd-current@FreeBSD.ORG Sat Sep 11 21:50:26 2004 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 6A89916A4CE; Sat, 11 Sep 2004 21:50:26 +0000 (GMT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2913D43D31; Sat, 11 Sep 2004 21:50:26 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.11/8.12.11) with ESMTP id i8BLo31Q049489; Sat, 11 Sep 2004 14:50:07 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200409112150.i8BLo31Q049489@gw.catspoiler.org> Date: Sat, 11 Sep 2004 14:50:03 -0700 (PDT) From: Don Lewis To: ma@dt.e-technik.uni-dortmund.de In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-current@FreeBSD.org cc: re@FreeBSD.org cc: bde@FreeBSD.org Subject: extfs at shutdown (was: Re: BETA3 showstoppers (read: critical bugs)) 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: Sat, 11 Sep 2004 21:50:26 -0000 On 6 Sep, Matthias Andree wrote: > - a mounted ext2 file system (read-only sufficient) still causes FreeBSD > to not flush its own ufs super blocks at shut down, causing an fsck > run at next reboot. > Workaround: umount all ext2 file systems before reboot/halt. Ext2 abuses BUF_KERNPROC() through its LCK_BUF() macro to store the contents of its private cache of group descriptors, inode and block bitmaps, etc. in system buffers for the entire time that the file system is mounted. These resources don't get synced with the rest of the file system data, even during the final system sync, and the data isn't written and the resources aren't released until the file system is unmounted. I think it is undesirable to defer writing a significant amount of metadata until after the final filesystem sync. I also think that fixed size metadata caches (EXT2_MAX_GROUP_LOADED) for each mounted ext2 file system is undesirable. I think this metadata should be handled the same was as ufs caches it. Unfortunately this would be a fairly intrusive change. BTW, it looks like a bug to me that ext2_unmount() writes the superblock before the other metadata.