ext4: prevent used blocks from being allocated during fast commit replay
authorXin Yin <yinxin.x@bytedance.com>
Mon, 10 Jan 2022 03:51:40 +0000 (11:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 17:34:13 +0000 (18:34 +0100)
commit0cb4480bc4f460cd5d906f0bc493082d3380ec1c
tree5bc1dc5c9308c78dd057852b3baab9768c7bcc91
parentd583cb17ee507b2f16ec17215491beb7fed0059a
ext4: prevent used blocks from being allocated during fast commit replay

commit 599ea31d13617c5484c40cdf50d88301dc351cfc upstream.

During fast commit replay procedure, we clear inode blocks bitmap in
ext4_ext_clear_bb(), this may cause ext4_mb_new_blocks_simple() allocate
blocks still in use.

Make ext4_fc_record_regions() also record physical disk regions used by
inodes during replay procedure. Then ext4_mb_new_blocks_simple() can
excludes these blocks in use.

Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
Link: https://lore.kernel.org/r/20220110035141.1980-2-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/ext4.h
fs/ext4/extents.c
fs/ext4/fast_commit.c