Re: REVIEW: Write primary superblock info to ALL secondaries during mkfs

Barry Naujok
2008-03-25T06:13:32Z

On Tue, 25 Mar 2008 17:00:17 +1100, David Chinner <dgc@sgi.com> wrote:

> On Tue, Mar 25, 2008 at 04:39:02PM +1100, Barry Naujok wrote:
>> Secondaries should contain redundant information from the primary
>> superblock. It does this for the filesystem geometry information,
>> but not inode values (rootino, rt inos, quota inos).
>>
>> This patch updates all the secondaries from the primary just before
>> it marks the filesystem as good to go.
>
> So it's got all the inodes, geometry, etc correct in them?
>
> So what about the fact that the kernel code doesn't keep all
> copies up to date? e.g. growfs will only write new values into
> a handful of superblocks, changing sunit/swidth via mount options
> only change the primary, etc....
>
> If you are going to change mkfs to keep them all up to date, the
> kernel code really needs to do the same thing....

Yes it should :) Geometry information was already done across all
the AGs.

>>
>> /*
>> - * Dump all inodes and buffers before marking us all done.
>> - * Need to drop references to inodes we still hold, first.
>> + * Flush out all inodes and buffers before marking us all done.
>> */
>> libxfs_rtmount_destroy(mp);
>> libxfs_icache_purge();
>> - libxfs_bcache_purge();
>> + libxfs_bcache_flush();
>
> Don't you still need a purge there to free all the objects in the
> cache?

No, the flush does what is required. There is no libxfs_icache_flush
at the moment, so I left the purge there for that.

libxfs_umount later on does a libxfs_*_purge() anyway.

The main thing is to make sure all objects are written to disk before
the sb_inprogress field in the primary superblock is zeroed.

Barry.