]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitadce2c1f55ae045acf4cf859436932a4c659b1a2
treeea45b9210a2421ca13e04ed5a53982ee46c377f8
parenta13ad94078321b7014ebf22e4b1018ee367b4928
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