Skip to content

Commit 0713ed0

Browse files
Lukas Czernertytso
authored andcommitted
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 <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
1 parent d863dc3 commit 0713ed0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/ext4/inode.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3681,8 +3681,11 @@ int ext4_block_zero_page_range(handle_t *handle,
36813681
err = 0;
36823682
if (ext4_should_journal_data(inode)) {
36833683
err = ext4_handle_dirty_metadata(handle, inode, bh);
3684-
} else
3684+
} else {
36853685
mark_buffer_dirty(bh);
3686+
if (ext4_test_inode_state(inode, EXT4_STATE_ORDERED_MODE))
3687+
err = ext4_jbd2_file_inode(handle, inode);
3688+
}
36863689

36873690
unlock:
36883691
unlock_page(page);

0 commit comments

Comments
 (0)