summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2013-05-27 23:32:35 -0400
committerTheodore Ts'o <tytso@mit.edu>2013-05-27 23:32:35 -0400
commit0713ed0cde76438d05849f1537d3aab46e099475 (patch)
tree036770cd667c43ade87485d4aab5f25e90308821
parentd863dc3614e489e11808f940a612b520ce1dff91 (diff)
ext4: Call ext4_jbd2_file_inode() after zeroing block
In data=ordered mode we should call ext4_jbd2_file_inode() so that crash after the truncate transaction has committed does not expose stall data in the tail of the block. Thanks Jan Kara for pointing that out. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--fs/ext4/inode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 9b3380327ae..e3d0fb9e78c 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3681,8 +3681,11 @@ int ext4_block_zero_page_range(handle_t *handle,
err = 0;
if (ext4_should_journal_data(inode)) {
err = ext4_handle_dirty_metadata(handle, inode, bh);
- } else
+ } else {
mark_buffer_dirty(bh);
+ if (ext4_test_inode_state(inode, EXT4_STATE_ORDERED_MODE))
+ err = ext4_jbd2_file_inode(handle, inode);
+ }
unlock:
unlock_page(page);