]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ext4, jbd2: Add barriers for file systems with exernal journals
authorTheodore Ts'o <tytso@mit.edu>
Mon, 31 May 2010 02:49:17 +0000 (22:49 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:21:10 +0000 (10:21 -0700)
commit7589529d0a233f28bd20e1b7775324dcf9cfb499
treed55bab3fdd972189146fe6941d4365d04289cee0
parentb235a77c0fb44fd428525591a968da14844b6f4d
ext4, jbd2: Add barriers for file systems with exernal journals

commit cc3e1bea5d87635c519da657303690f5538bb4eb upstream (as of v2.6.33-rc3)

This is a bit complicated because we are trying to optimize when we
send barriers to the fs data disk.  We could just throw in an extra
barrier to the data disk whenever we send a barrier to the journal
disk, but that's not always strictly necessary.

We only need to send a barrier during a commit when there are data
blocks which are must be written out due to an inode written in
ordered mode, or if fsync() depends on the commit to force data blocks
to disk.  Finally, before we drop transactions from the beginning of
the journal during a checkpoint operation, we need to guarantee that
any blocks that were flushed out to the data disk are firmly on the
rust platter before we drop the transaction from the journal.

Thanks to Oleg Drokin for pointing out this flaw in ext3/ext4.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/fsync.c
fs/jbd2/checkpoint.c
fs/jbd2/commit.c
include/linux/jbd2.h