btrfs-progs: lowmem check: Fix false alert on missing chunk or dev extent
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Wed, 31 May 2017 05:56:09 +0000 (13:56 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Jul 2017 11:35:11 +0000 (13:35 +0200)
commitd39731a53bb6212effc184719296e39f5200ee94
tree42a914a6904fc4d3ee947c624713026bf87b734d
parent6e7b1bbdecfa89d4bd3b51e56d01b29274fe3902
btrfs-progs: lowmem check: Fix false alert on missing chunk or dev extent

When checking chunk or dev extent, lowmem mode uses chunk length as dev
extent length, and if they mismatch, report missing chunk or dev extent
like:
------
ERROR: chunk[256 4324327424) stripe 0 did not find the related dev extent
ERROR: chunk[256 4324327424) stripe 1 did not find the related dev extent
ERROR: chunk[256 4324327424) stripe 2 did not find the related dev extent
------

However, only for Single/DUP/RAID1 profiles chunk length is the same as
dev extent length.
For other profiles, this will cause tons of false alert.

Fix it by using correct stripe length when checking chunk and dev extent
items.

This fixes the mkfs test failure when using lowmem mode check.

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