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
Attachment:
signature.asc
Description: This is a digitally signed message part