From owner-freebsd-current@FreeBSD.ORG Sat Dec 6 18:26:39 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 6432116A4CE for ; Sat, 6 Dec 2003 18:26:39 -0800 (PST) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 106EE43F75 for ; Sat, 6 Dec 2003 18:26:38 -0800 (PST) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9p2/8.12.9) with ESMTP id hB72QQeF043288; Sat, 6 Dec 2003 18:26:31 -0800 (PST) (envelope-from truckman@FreeBSD.org) Message-Id: <200312070226.hB72QQeF043288@gw.catspoiler.org> Date: Sat, 6 Dec 2003 18:26:26 -0800 (PST) From: Don Lewis To: bruce@cran.org.uk In-Reply-To: <20031206164818.GA4458@buffy.brucec.backnet> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-current@FreeBSD.org cc: avleeuwen@piwebs.com Subject: Re: 5.2-BETA: giving up on 4 buffers (ata) 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: Sun, 07 Dec 2003 02:26:39 -0000 On 6 Dec, Bruce Cran wrote: > On Sat, Dec 06, 2003 at 10:47:46AM +0100, Arjan van Leeuwen wrote: > Content-Description: signed data >> On Saturday 06 December 2003 05:33, Bruce Evans wrote: >> > As a workaround, unmount ext2fs file systems before rebooting. >> > Unmounting most file systems before rebooting should be the default >> > anyway (handled by shutdown(8) and reboot(8)), since unmounting may >> > fail and vfs_unmountall() in the kernel has no good way to log errors. >> >> Thanks. It won't help though, as I don't have any ext2fs file systems, only >> UFS. Also, my problem isn't 3 months old - I'm only seeing it since a few >> weeks. >> > > I've been seeing this problem for a good few months now - if I boot into > single-user mode (using boot -s), fsck the (UFS2 only) disks and then type > 'reboot', the system will always give up on at least 1 buffer, sometimes > even 4 or 5. Of course, since / was mounted ro the filesystem is still > clean when the system is rebooted, but it seems something thinks there's > data to be written to a read-only filesystem! The root filesystem is UFS2 > without softupdates. I tracked down the UFS version of this problem. We were getting burned by inode atime updates. After fsck repaired the root file system, it called ffs_reload() to reload the superblock and other info into the kernel. This had the side effect of clearing fs->fs_ronly, which made the left hand think the file system was read-write, while the right hand thought it was still read-only. Once fs_ronly was cleared, ffs_update() would attempt to do inode atime updates, which would get wedged in the file system cache. The bug looks old. I'm suprised it hasn't been fixed before. Index: sys/ufs/ffs/ffs_vfsops.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vfsops.c,v retrieving revision 1.225 diff -u -r1.225 ffs_vfsops.c --- sys/ufs/ffs/ffs_vfsops.c 12 Nov 2003 08:01:40 -0000 1.225 +++ sys/ufs/ffs/ffs_vfsops.c 7 Dec 2003 01:13:35 -0000 @@ -455,6 +455,8 @@ newfs->fs_maxcluster = fs->fs_maxcluster; newfs->fs_contigdirs = fs->fs_contigdirs; newfs->fs_active = fs->fs_active; + /* The file system is still read-only. */ + newfs->fs_ronly = 1; sblockloc = fs->fs_sblockloc; bcopy(newfs, fs, (u_int)fs->fs_sbsize); brelse(bp);