Skip to content

Commit

Permalink
Btrfs: return the internal error unchanged if btrfs_get_extent_fiemap…
Browse files Browse the repository at this point in the history
…() 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>
  • Loading branch information
Jeff Liu authored and David Sterba committed Feb 15, 2012
1 parent 8f24b49 commit 6af021d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 6af021d

Please sign in to comment.