]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: wait on all pending commits in ext4_sync_fs()
authorTheodore Ts'o <tytso@mit.edu>
Sun, 16 Nov 2008 16:05:37 +0000 (11:05 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Dec 2008 18:55:42 +0000 (10:55 -0800)
commit84b9421374baf41b1643bfaf16c872cf177ca9b7
tree7184919ca7ba9e1101257ee02d573b175eab4210
parentabed0115847f4dc747a761857506b03b89550a3e
ext4: wait on all pending commits in ext4_sync_fs()

(cherry picked from commit 14ce0cb411c88681ab8f3a4c9caa7f42e97a3184)

In ext4_sync_fs, we only wait for a commit to finish if we started it,
but there may be one already in progress which will not be synced.

In the case of a data=ordered umount with pending long symlinks which
are delayed due to a long list of other I/O on the backing block
device, this causes the buffer associated with the long symlinks to
not be moved to the inode dirty list in the second phase of
fsync_super.  Then, before they can be dirtied again, kjournald exits,
seeing the UMOUNT flag and the dirty pages are never written to the
backing block device, causing long symlink corruption and exposing new
or previously freed block data to userspace.

To ensure all commits are synced, we flush all journal commits now
when sync_fs'ing ext4.

Signed-off-by: Arthur Jones <ajones@riverbed.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/super.c