diff options
author | Li Dongyang <dongyangli@ddn.com> | 2022-12-20 00:05:44 +1100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-01-25 21:38:33 -0500 |
commit | 6cae615a47dfe37fe5fd096accb82579813a6366 (patch) | |
tree | a11db3ecae927a117eb47827c009449c5ebaa809 /ext2ed | |
parent | f7c9598655420102353ff87946f5bf77ebf465bc (diff) | |
download | e2fsprogs-6cae615a47dfe37fe5fd096accb82579813a6366.tar.gz |
e2fsck: optimize clone_file on large devices
When cloning multiply-claimed blocks for an inode,
clone_file() uses ext2fs_block_iterate3() to iterate
every block calling clone_file_block().
clone_file_block() calls check_if_fs_cluster(), even
the block is not on the block_dup_map, which could take
a long time on a large device.
Only check if it's metadata block when we need to clone
it.
Test block_metadata_map in check_if_fs_block()
and check_if_fs_cluster(), so we don't need to go over
each bg every time. The metadata blocks are already
marked in the bitmap.
Before this patch on a 500TB device with 3 files having
3 multiply-claimed blocks between them, pass1b is stuck
for more than 48 hours without progressing,
before e2fsck was terminated.
After this patch pass1b could finish in 180 seconds.
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'ext2ed')
0 files changed, 0 insertions, 0 deletions