diff options
author | Jeff Mahoney <jeffm@suse.com> | 2017-07-25 16:51:32 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-10-06 13:41:01 +0200 |
commit | 756105181e57074ce9d232e397abc0121cbb6bf6 (patch) | |
tree | 8f7fbb106fd5e2d4210a450a53387c63a3eb2f6c /extent_io.h | |
parent | 530ca513078d2e8682647da707681a024fa3120b (diff) |
btrfs-progs: check: supplement extent backref list with rbtree
For the pathlogical case, like xfstests generic/297 that creates a
large file consisting of one, repeating reflinked extent, fsck can
take hours. The root cause is that calling find_data_backref while
iterating the extent records is an O(n^2) algorithm. For my
example test run, n was 2*2^20 and fsck was at 8 hours and counting.
This patch supplements the list with an rbtree and drops the runtime
of that testcase to about 20 seconds.
A previous version of this patch introduced a regression that would
have corrupted file systems during repair. It was traced to the
compare algorithm honoring ->bytes regardless of whether the
reference had been found and a failure to reinsert nodes after
the target reference was found.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent_io.h')
0 files changed, 0 insertions, 0 deletions