btrfs: return error if we're unable to read device stats
authorJosef Bacik <josef@toxicpanda.com>
Fri, 18 Sep 2020 20:44:33 +0000 (16:44 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:17:58 +0000 (12:17 +0200)
commit92e26df43b1a9725c205a7e4416240ce72eac4a3
treeea45b9210a2421ca13e04ed5a53982ee46c377f8
parent124604eb50f88e6c1ff6587bdd2fc09bea810b32
btrfs: return error if we're unable to read device stats

I noticed when fixing device stats for seed devices that we simply threw
away the return value from btrfs_search_slot().  This is because we may
not have stat items, but we could very well get an error, and thus miss
reporting the error up the chain.

Fix this by returning ret if it's an actual error, and then stop trying
to init the rest of the devices stats and return the error up the chain.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c