

This patch fixes the data loss which can occur when unmounting a
data=journal ext3 filesystem.

The core problem is that the VFS doesn't tell the filesystem enough
about what is happening.  ext3 _needs_ to know the difference between
regular memory-cleansing writeback and sync-for-data-integrity
purposes.

(These two operations are really quite distinct, and the kernel has got
it wrong for ages.  Even now, kupdate is running filemap_fdatawait()
quite needlessly)

In the early days, ext3 would assume that a write_super() call meant
"sync".  That worked OK.

But that slowed down the kupdate function - it doesn't need to wait on
the writeout.  So we took the `wait' out of ext3_write_super().  And
that worked OK too, because the VFS would later write back all the
dirty data for us.

But then an unrelated optimisation to the truncate path caused that to
not work any more, and we were exposed.



This patch adds a new super_block operation `sync_fs', whose mandate is
to "sync the filesystem" for data-integrity purposes.  ie: it is a
synchronous writeout, whereas write_super is an asynchronous flush.

It is a minimal fix.  Really all the `sync' code in the VFS needs a
rethink.  It is _very_ ext2-centric, and needs to be redesigned to
provide more information to sophisticated filesystems about what is
going on.

But that's not a 2.4 project.  And it's not looking like a 2.5 project
either - I shall be proposing the same fix for 2.5.
