Skip to content

Commit 183aa1d

Browse files
Shida Zhangtytso
authored andcommitted
ext4: remove the special buffer dirty handling in do_journal_get_write_access
This kinda revert the commit 56d35a4("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 <[email protected]> Signed-off-by: Shida Zhang <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent cb3de5f commit 183aa1d

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

fs/ext4/inode.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,27 +1005,11 @@ static int ext4_dirty_journalled_data(handle_t *handle, struct buffer_head *bh)
10051005
int do_journal_get_write_access(handle_t *handle, struct inode *inode,
10061006
struct buffer_head *bh)
10071007
{
1008-
int dirty = buffer_dirty(bh);
1009-
int ret;
1010-
10111008
if (!buffer_mapped(bh) || buffer_freed(bh))
10121009
return 0;
1013-
/*
1014-
* ext4_block_write_begin() could have dirtied some buffers. Clean
1015-
* the dirty bit as jbd2_journal_get_write_access() could complain
1016-
* otherwise about fs integrity issues. Setting of the dirty bit
1017-
* by ext4_block_write_begin() isn't a real problem here as we clear
1018-
* the bit before releasing a page lock and thus writeback cannot
1019-
* ever write the buffer.
1020-
*/
1021-
if (dirty)
1022-
clear_buffer_dirty(bh);
10231010
BUFFER_TRACE(bh, "get write access");
1024-
ret = ext4_journal_get_write_access(handle, inode->i_sb, bh,
1011+
return ext4_journal_get_write_access(handle, inode->i_sb, bh,
10251012
EXT4_JTR_NONE);
1026-
if (!ret && dirty)
1027-
ret = ext4_dirty_journalled_data(handle, bh);
1028-
return ret;
10291013
}
10301014

10311015
int ext4_block_write_begin(handle_t *handle, struct folio *folio,

0 commit comments

Comments
 (0)