ext4: Clear dirty bit from pages without data to write
authorJan Kara <jack@suse.cz>
Wed, 29 Mar 2023 15:49:35 +0000 (17:49 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 14 Apr 2023 23:55:44 +0000 (19:55 -0400)
commit5e1bdea6391d09fde424a1406a04e01b208a04d2
tree4b0f8a279c4564181402685b55395a160dd8db53
parent265e72efa99fcc0959f8d33d346a7e0f2e3fe201
ext4: Clear dirty bit from pages without data to write

With journalled data it can happen that checkpointing code will write
out page contents without clearing the page dirty bit. The logic in
ext4_page_nomap_can_writeout() then results in us never calling
mpage_submit_page() and thus clearing the dirty bit. Drop the
optimization with ext4_page_nomap_can_writeout() and just always call to
mpage_submit_page(). ext4_bio_write_page() knows when to redirty the
page and the additional clearing & setting of page dirty bit for ordered
mode writeout is not that expensive to jump through the hoops for it.

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230329154950.19720-4-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c