diff options
author | Anand Jain <anand.jain@oracle.com> | 2017-10-09 11:07:44 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-10-30 12:27:59 +0100 |
commit | 45dbdbc9f66c749fa329130dcd641eb0606129d0 (patch) | |
tree | c7af973c79ef4db8951e8b2cf2f588857d9c6e11 /fs/btrfs | |
parent | adfb69af7d8cb6a3958f75aad1ef4bc96891d116 (diff) | |
download | op-kernel-dev-45dbdbc9f66c749fa329130dcd641eb0606129d0.zip op-kernel-dev-45dbdbc9f66c749fa329130dcd641eb0606129d0.tar.gz |
btrfs: fix EIO misuse to report missing degraded option
EIO is only for the IO failure to the device, avoid it. Use ENOENT as
that's the closest error code describing what happened.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 23b628c..3896dfd 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -6437,7 +6437,7 @@ static int read_one_chunk(struct btrfs_fs_info *fs_info, struct btrfs_key *key, !btrfs_test_opt(fs_info, DEGRADED)) { free_extent_map(em); btrfs_report_missing_device(fs_info, devid, uuid); - return -EIO; + return -ENOENT; } if (!map->stripes[i].dev) { map->stripes[i].dev = @@ -6570,7 +6570,7 @@ static int read_one_dev(struct btrfs_fs_info *fs_info, if (!device) { if (!btrfs_test_opt(fs_info, DEGRADED)) { btrfs_report_missing_device(fs_info, devid, dev_uuid); - return -EIO; + return -ENOENT; } device = add_missing_dev(fs_devices, devid, dev_uuid); @@ -6585,7 +6585,7 @@ static int read_one_dev(struct btrfs_fs_info *fs_info, if (!device->bdev) { btrfs_report_missing_device(fs_info, devid, dev_uuid); if (!btrfs_test_opt(fs_info, DEGRADED)) - return -EIO; + return -ENOENT; } if(!device->bdev && !device->missing) { |