mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-09 10:47:09 +00:00
[BUG] When testing my new RAID56J code, there is a bug causing dev extents overlapping. Although both modes can detect the problem, lowmem has leaked some extent buffers: $ btrfs check --mode=lowmem /dev/test/scratch1 Opening filesystem to check... Checking filesystem on /dev/test/scratch1 UUID: 65775ce9-bb9d-4f61-a210-beea52eef090 [1/7] checking root items [2/7] checking extents ERROR: dev extent devid 1 offset 1095761920 len 1073741824 overlap with previous dev extent end 1096810496 ERROR: dev extent devid 2 offset 1351614464 len 1073741824 overlap with previous dev extent end 1352663040 ERROR: dev extent devid 3 offset 1351614464 len 1073741824 overlap with previous dev extent end 1352663040 ERROR: errors found in extent allocation tree or chunk allocation [3/7] checking free space tree [4/7] checking fs roots [5/7] checking only csums items (without verifying data) [6/7] checking root refs done with fs roots in lowmem mode, skipping [7/7] checking quota groups skipped (not enabled on this FS) found 3221372928 bytes used, error(s) found total csum bytes: 0 total tree bytes: 147456 total fs tree bytes: 32768 total extent tree bytes: 16384 btree space waste bytes: 136231 file data blocks allocated: 3221225472 referenced 3221225472 extent buffer leak: start 30752768 len 16384 extent buffer leak: start 30752768 len 16384 extent buffer leak: start 30752768 len 16384 [CAUSE] In the function check_dev_item(), we iterate through all the dev extents, but when we found overlapping extents, we exit without releasing the path, causing extent buffer leakage. [FIX] Just release the path before we exit the function. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
btrfsck.h | ||
common.h | ||
main.c | ||
mode-common.c | ||
mode-common.h | ||
mode-lowmem.c | ||
mode-lowmem.h | ||
mode-original.h | ||
qgroup-verify.c | ||
qgroup-verify.h |