btrfs-progs: check: Enhance leaf traversal function to handle missing inode item
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Wed, 21 Sep 2016 02:37:27 +0000 (10:37 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 14 Dec 2016 14:06:34 +0000 (15:06 +0100)
commit8b125cdd7eba55fc4b6ed3c32ac47ad870f2b092
treea9aae53e12f0b451add2eafc91dd67604d50822d
parent5e2dc770471bc8ff394e70ff5af0dbec1bf0f705
btrfs-progs: check: Enhance leaf traversal function to handle missing inode item

The leaf traversal function in lowmem mode will skip to the first inode
item of leaf and begin to check the inode.

That's designed to avoid checking overlapping part of a leaf.

But that will cause problem in fsck/010 test case, as in that case inode
item of the first inode(256) is missing.
So above traversal will check from inode 257 and found nothing wrong.

The fix is done in 2 part:
1) Manually check the first inode
   To avoid case like fsck/010

2) Check inode if ino changes from the first ino of a leaf
   To avoid missing inode_item problem.

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