mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-14 01:31:02 +00:00
btrfs-progs: chunk-recover: improve error handling in insert_stripe
Switch to negative errnos, the callchain handles errors. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
1620e2a042
commit
b83e93e65d
@ -1947,9 +1947,12 @@ static int insert_stripe(struct list_head *devexts,
|
||||
dev = btrfs_find_device_by_devid(rc->fs_devices, devext->objectid,
|
||||
0);
|
||||
if (!dev)
|
||||
return 1;
|
||||
BUG_ON(btrfs_find_device_by_devid(rc->fs_devices, devext->objectid,
|
||||
1));
|
||||
return -ENOENT;
|
||||
if (btrfs_find_device_by_devid(rc->fs_devices, devext->objectid, 1)) {
|
||||
error("unexpected: found another device with id %llu",
|
||||
(unsigned long long)devext->objectid);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
chunk->stripes[index].devid = devext->objectid;
|
||||
chunk->stripes[index].offset = devext->offset;
|
||||
|
Loading…
Reference in New Issue
Block a user