ext4: fix fast commit may miss tracking range for FALLOC_FL_ZERO_RANGE
authorXin Yin <yinxin.x@bytedance.com>
Tue, 21 Dec 2021 02:28:39 +0000 (10:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:54:27 +0000 (10:54 +0100)
commite4221629d5e1479db400d8a4cbf865c65a457630
tree240af8f278f79ed21869c015751034c4fa4d35f3
parent720508dd118d04035875823f44bcd27388ff39b2
ext4: fix fast commit may miss tracking range for FALLOC_FL_ZERO_RANGE

commit 5e4d0eba1ccaf19f93222abdeda5a368be141785 upstream.

when call falloc with FALLOC_FL_ZERO_RANGE, to set an range to unwritten,
which has been already initialized. If the range is align to blocksize,
fast commit will not track range for this change.

Also track range for unwritten range in ext4_map_blocks().

Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20211221022839.374606-1-yinxin.x@bytedance.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c
fs/ext4/inode.c