[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1338881735.2507.36.camel@sauron.fi.intel.com>
Date: Tue, 05 Jun 2012 10:35:35 +0300
From: Artem Bityutskiy <dedekind1@...il.com>
To: Boaz Harrosh <bharrosh@...asas.com>
Cc: Linux FS Maling List <linux-fsdevel@...r.kernel.org>,
Linux Kernel Maling List <linux-kernel@...r.kernel.org>,
Benny Halevy <bhalevy@...ian.com>, osd-dev@...n-osd.org
Subject: Re: [PATCH] exofs: stop using s_dirt
On Mon, 2012-06-04 at 19:12 +0300, Boaz Harrosh wrote:
> I have one question though, which I did not understand at the time?
>
> Today at exofs_write_super() we call exofs_sync_fs() (super_operations->sync_fs)
> Who/when calls ->sync_fs() without the ->write_super() below.
Not sure I understood your question correctly, but:
o VFS calls '->sync_fs()' on
* sync(2)
* syncfs(2)
* when unmounting, before calling '->put_super()'
* when re-mounting, before calling '->remount_fs()'
* when freezing (happens when suspending the system)
* when the underlying block device is synced (see 'fsync_bdev()')
o '->write_super()' is called only from one place - from the
'sync_supers()' function (which is only used by the 'sync_supers'
kernel thread) if the superblock is dirty. This thread wakes up every
5 seconds and calls '->write_super()' for all dirty superblocks.
In case of exofs you never set 's_dirt' to non-zero, which means that
'exofs_write_super()' is never called. This means we can remove it and
this won't change anything for exofs.
Basically, in the ideal world where power-cuts and unclean reboots do
not exist, '->write_super()' is not needed because the superblock will
be synced on unmount. The 'write_super()' stuff is about making sure
that your dirty superblock stays dirty only for limited amount of time
(defined via /proc/sys/vm/dirty_writeback_centisecs) and then gets
synced so you have less chances end up with a not completely up-to-date
superblock.
--
Best Regards,
Artem Bityutskiy
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists