]> git.itanic.dy.fi Git - linux-stable/commit
ext4: Fix special handling of journalled data from extent zeroing
authorJan Kara <jack@suse.cz>
Wed, 29 Mar 2023 15:49:39 +0000 (17:49 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 14 Apr 2023 23:56:53 +0000 (19:56 -0400)
commit783ae448b7a21ca59ffe5bc261c17d9c3ebfe2ad
treec100de92287ff1066353fbd3a0a655f81079bb9b
parentc000dfec7e88cee660cbc594c9716ecc979dc1f1
ext4: Fix special handling of journalled data from extent zeroing

The handling of journalled data in ext4_zero_range() is incomplete. We
do not need to commit running transaction but we rather need to
checkpoint pages with journalled data. If we don't, journal tail can be
advanced beyond transaction containing the journalled data and if we
then crash before committing the transaction doing the zeroing we will
have inconsistent (too old) data in the file. Make sure file pages with
journalled data are properly checkpointed before removing them from the
page cache.

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