ext4: Use bforget() in no journal mode for ext4_journal_{forget,revoke}()
commit523a2ab5bf81efa0fc9a1b6afc43e729ddae58f0
authorTheodore Ts'o <tytso@mit.edu>
Thu, 10 Sep 2009 01:32:41 +0000 (9 21:32 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 16:06:30 +0000 (14 08:06 -0800)
tree0b1f72a4cfa68c498986016295dea5934ec45baf
parent6758feb58f9c66dbbd8ef67543deb03311296f3a
ext4: Use bforget() in no journal mode for ext4_journal_{forget,revoke}()

(cherry picked from commit c7acb4c16646943180bd221c167a077e0a084f9c)

When ext4 is using a journal, a metadata block which is deallocated
must be passed into the journal layer so it can be dropped from the
current transaction and/or revoked.  This is done by calling the
functions ext4_journal_forget() and ext4_journal_revoke(), which call
jbd2_journal_forget(), and jbd2_journal_revoke(), respectively.

Since the jbd2_journal_forget() and jbd2_journal_revoke() call
bforget(), if ext4 is not using a journal, ext4_journal_forget() and
ext4_journal_revoke() must call bforget() to avoid a dirty metadata
block overwriting a block after it has been reallocated and reused for
another inode's data block.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/ext4_jbd2.c