btrfs-progs: check: fix false alert on dropped leaf in lowmem mode
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Wed, 18 Jan 2017 05:21:07 +0000 (13:21 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 25 Jan 2017 08:48:03 +0000 (09:48 +0100)
commitb73d67f20aa9bbb8aecc02f5725b1db193e87b48
treeed10f285ddc7b3cbc87d29159db26734362a552f
parent0e95fff4fff4688c82c150833a021a9399da094c
btrfs-progs: check: fix false alert on dropped leaf in lowmem mode

For btrfs-progs test case 021-partially-dropped-snapshot-case, if the
first leaf is already dropped, btrfs check low-memory mode will report
false alert:

checking fs roots
checksum verify failed on 29917184 found E4E3BDB6 wanted 00000000
checksum verify failed on 29917184 found E4E3BDB6 wanted 00000000
checksum verify failed on 29917184 found E4E3BDB6 wanted 00000000
checksum verify failed on 29917184 found E4E3BDB6 wanted 00000000

This is caused by we are calling check_fs_first_inode() function,
unlike the rest part of check_fs_root_v2(), it doesn't have enough check
on dropping progress, and caused the false alert.

Fix it by checking dropping progress before searching slot.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c