e2fsprogs/tests/f_dup_resize
Li Dongyang 6cae615a47 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>
2023-01-25 21:38:33 -05:00
..
expect.1 e2fsck: optimize clone_file on large devices 2023-01-25 21:38:33 -05:00
expect.2 tests: update mke2fs.conf to create 256 byte inodes by default 2021-08-15 10:36:07 -04:00
name Don't offer to update or clone the resize inode when e2fsck deals with 2005-04-14 17:10:14 -04:00
script tests: force test file systems to be built for the Linux OS 2021-07-29 10:31:53 -04:00