mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-15 19:05:50 +00:00
4c282411eb
User reported that test fsck-tests/037-freespacetree-repair fails: # TEST=037\* ./fsck-tests.sh [TEST/fsck] 037-freespacetree-repair btrfs check should have detected corruption test failed for case 037-freespacetree-repair The test tries to corrupt FST, call btrfs check readonly then repair FST using btrfs check. Above case failed at the second readonly check step. Test log said "cache and super generation don't match, space cache will be invalidated" which is printed by validate_free_space_cache(). If cache_generation of the superblock is not -1ULL, validate_free_space_cache() requires that cache_generation must equal to the superblock's generation. Otherwise, it skips the check of space cache(v1, v2) like the above case where the sb cache_generation is 0. Since kernel commit 948462294577 ("btrfs: keep sb cache_generation consistent with space_cache"), sb cache_generation will be set to be 0 once space cache v1 is disabled (nospace_cache/space_cache=v2). But progs check was forgotten to be added the 0 case support. Fix it by adding the condition if sb cache_generation is 0 in validate_free_space_cache() as the 0 case is valid now since the kernel commit mentioned above. Issue: #338 Signed-off-by: Su Yue <l@damenly.su> Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: David Sterba <dsterba@suse.com> |
||
---|---|---|
.. | ||
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 |