Re: 5.2-BETA: giving up on 4 buffers (ata)

From: Don Lewis <truckman_at_FreeBSD.org>
Date: Sat, 6 Dec 2003 18:26:26 -0800 (PST)
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
_at__at_ -455,6 +455,8 _at__at_
 	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);
Received on Sat Dec 06 2003 - 17:26:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:32 UTC