diff options
author | Qu Wenruo <wqu@suse.com> | 2018-09-14 15:25:04 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-10-25 16:11:40 +0200 |
commit | 6a659dbfde228f3e5287f445816b29969a482fe8 (patch) | |
tree | 0786a34b1610a93684149fc690925ed0847c2aef | |
parent | 251d32ea5cd1cf74cb52557f3a75930e947f170f (diff) |
btrfs-progs: convert: Make read_disk_extent return more -EIO instead of -1
When pread64() returns value smaller than expected, it normally means
EIO, so just return -EIO to replace the intermediate number. So when IO
fails, we should be able to get more meaningful error number of than
EPERM.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | convert/source-fs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/convert/source-fs.c b/convert/source-fs.c index b6d08370..5660a22c 100644 --- a/convert/source-fs.c +++ b/convert/source-fs.c @@ -201,7 +201,7 @@ int read_disk_extent(struct btrfs_root *root, u64 bytenr, ret = 0; fail: if (ret > 0) - ret = -1; + ret = -EIO; return ret; } |