extfs at shutdown (was: Re: BETA3 showstoppers (read: critical bugs))

Don Lewis truckman at FreeBSD.org
Sat Sep 11 14:50:26 PDT 2004


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.





More information about the freebsd-current mailing list