ext3: Fix dirtying of journalled buffers in data=journal mode
commit5f11e6a44059f728dddd8d0dbe5b4368ea93575b
authorJan Kara <jack@suse.cz>
Thu, 5 Aug 2010 10:38:26 +0000 (5 12:38 +0200)
committerJan Kara <jack@suse.cz>
Thu, 5 Aug 2010 19:28:28 +0000 (5 21:28 +0200)
treec66eed7a13b1de48d9a6539b9a7c7a27bda706c6
parentaa32a796389bedbcf1c7714385b18714a0743810
ext3: Fix dirtying of journalled buffers in data=journal mode

In data=journal mode, we still use block_write_begin() to prepare page for
writing. This function can occasionally mark buffer dirty which violates
journalling assumptions - when a buffer is part of a transaction, it should be
dirty and a buffer can be already part of a forget list of some transaction
when block_write_begin() gets called. This violation of journalling assumptions
then results in "JBD: Spotted dirty metadata buffer..." warnings.

In fact, temporary dirtying the buffer while the page is still locked does not
really cause problems to the journalling because we won't write the buffer
until the page gets unlocked. So we just have to make sure to clear dirty bits
before unlocking the page.

Reviewed-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext3/inode.c