diff options
author | Shida Zhang <zhangshida@kylinos.cn> | 2024-08-30 08:37:39 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2024-09-04 05:14:17 +0300 |
commit | 183aa1d3baea18b199505455a0247b13de826e2f (patch) | |
tree | edb6a9f4f0dc4763daed3713eaa624dee8c8e3ae /fs/ext4 | |
parent | cb3de5fc876ee9ef2b830c9e6cdafac5c90903ef (diff) | |
download | linux-183aa1d3baea18b199505455a0247b13de826e2f.tar.xz |
ext4: remove the special buffer dirty handling in do_journal_get_write_access
This kinda revert the commit 56d35a4cd13e("ext4: Fix dirtying of
journalled buffers in data=journal mode") made by Jan 14 years ago,
since the do_get_write_access() itself can deal with the extra
unexpected buf dirting things in a proper way now.
Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Shida Zhang <zhangshida@kylinos.cn>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240830053739.3588573-5-zhangshida@kylinos.cn
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/inode.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index a11e2626b5f6..7475deef9793 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1005,27 +1005,11 @@ static int ext4_dirty_journalled_data(handle_t *handle, struct buffer_head *bh) int do_journal_get_write_access(handle_t *handle, struct inode *inode, struct buffer_head *bh) { - int dirty = buffer_dirty(bh); - int ret; - if (!buffer_mapped(bh) || buffer_freed(bh)) return 0; - /* - * ext4_block_write_begin() could have dirtied some buffers. Clean - * the dirty bit as jbd2_journal_get_write_access() could complain - * otherwise about fs integrity issues. Setting of the dirty bit - * by ext4_block_write_begin() isn't a real problem here as we clear - * the bit before releasing a page lock and thus writeback cannot - * ever write the buffer. - */ - if (dirty) - clear_buffer_dirty(bh); BUFFER_TRACE(bh, "get write access"); - ret = ext4_journal_get_write_access(handle, inode->i_sb, bh, + return ext4_journal_get_write_access(handle, inode->i_sb, bh, EXT4_JTR_NONE); - if (!ret && dirty) - ret = ext4_dirty_journalled_data(handle, bh); - return ret; } int ext4_block_write_begin(handle_t *handle, struct folio *folio, |