aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorXin Yin <[email protected]>2022-01-10 03:51:40 +0000
committerTheodore Ts'o <[email protected]>2022-02-03 15:56:01 +0000
commit599ea31d13617c5484c40cdf50d88301dc351cfc (patch)
tree6fe6f9d74d469f7bb47a18aa3994f3bb079c3e04 /fs/ext4/extents.c
parentext4: don't use the orphan list when migrating an inode (diff)
downloadkernel-599ea31d13617c5484c40cdf50d88301dc351cfc.tar.gz
kernel-599ea31d13617c5484c40cdf50d88301dc351cfc.zip
ext4: prevent used blocks from being allocated during fast commit replay
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]> Cc: [email protected]
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 1077ce7e189f..5dd13108d4b7 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -6093,11 +6093,15 @@ int ext4_ext_clear_bb(struct inode *inode)
ext4_mb_mark_bb(inode->i_sb,
path[j].p_block, 1, 0);
+ ext4_fc_record_regions(inode->i_sb, inode->i_ino,
+ 0, path[j].p_block, 1, 1);
}
ext4_ext_drop_refs(path);
kfree(path);
}
ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
+ ext4_fc_record_regions(inode->i_sb, inode->i_ino,
+ map.m_lblk, map.m_pblk, map.m_len, 1);
}
cur = cur + map.m_len;
}