提交 0713ed0c 编写于 作者: L Lukas Czerner 提交者: Theodore Ts'o

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: NLukas Czerner <lczerner@redhat.com>
Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
上级 d863dc36
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册