Re: [RFC] write_super is for syncing

Chris Mason (mason@suse.com)
Tue, 12 Mar 2002 17:48:47 -0500


On Tuesday, March 12, 2002 02:15:40 PM -0800 Andrew Morton <akpm@zip.com.au> wrote:

> Chris Mason wrote:
>>
>> Hi everyone,
>>
>> The fact that write_super gets called for both syncs and periodic
>> commits causes problems for the journaled filesystems, since we
>> need to trigger commits on write_super to have sync() behave
>> properly.
>>
>> So, this patch adds a new super operation called commit_super,
>> and extends struct super.s_dirt a little so the filesystem
>> can say: call me on sync() but don't call me from kupdate.
>>
>> if (s_dirt & S_SUPER_DIRTY) call me from kupdate and on sync
>> if (s_dirt & S_SUPER_DIRTY_COMMIT) call me on sync only.
>>
>
> I'm not quite sure why these flags exist? Would it not be
> sufficient to just call ->write_super() inside kupdate,
> and ->commit_super in fsync_dev()? (With a ->write_super
> fallback, of course).

fsync_dev(dev != 0) is easy, you can ignore the dirty flag
and call commit_super on the proper device.

But, the loop in sync_supers(dev == 0) is harder, it expects
some flag it can check, and it expects the callback to the FS
will clear that flag. Adding a new flag seemed like more fun
than redoing the locking and super walk. I'm curious to hear what
Al thinks of it though.

-chris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/