summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Liu <jeff.liu@oracle.com>2012-02-09 07:25:50 +0100
committerDavid Sterba <dsterba@suse.cz>2012-02-15 16:40:23 +0100
commit6af021d8fc3bcce790e7fbb391e39c5920fa3f71 (patch)
tree9b3e3f49627aed11fa3105c469b1719c71a39636 /fs
parentBtrfs: avoid positive number with ERR_PTR (diff)
downloadlinux-6af021d8fc3bcce790e7fbb391e39c5920fa3f71.tar.xz
linux-6af021d8fc3bcce790e7fbb391e39c5920fa3f71.zip
Btrfs: return the internal error unchanged if btrfs_get_extent_fiemap() call failed for SEEK_DATA/SEEK_HOLE inquiry
Given that ENXIO only means "offset beyond EOF" for either SEEK_DATA or SEEK_HOLE inquiry in a desired file range, so we should return the internal error unchanged if btrfs_get_extent_fiemap() call failed, rather than ENXIO. Cc: Dave Chinner <david@fromorbit.com> Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 0621a3a7d5d1..3a520899b024 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1755,7 +1755,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
start - root->sectorsize,
root->sectorsize, 0);
if (IS_ERR(em)) {
- ret = -ENXIO;
+ ret = PTR_ERR(em);
goto out;
}
last_end = em->start + em->len;
@@ -1767,7 +1767,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
while (1) {
em = btrfs_get_extent_fiemap(inode, NULL, 0, start, len, 0);
if (IS_ERR(em)) {
- ret = -ENXIO;
+ ret = PTR_ERR(em);
break;
}