diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-11-12 06:54:02 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-11-15 22:34:05 -0500 |
commit | eab4e63368b4cfa597dbdac66d1a7a836a693b7d (patch) | |
tree | 37d6756a3fd9e43ecf65d1b4a3950ecd34ad653f /fs/xfs/xfs_buf.c | |
parent | c3f8fc73ac97b76a12692088ef9cace9af8422c0 (diff) |
xfs: uncached buffer reads need to return an error
With verification being done as an IO completion callback, different
errors can be returned from a read. Uncached reads only return a
buffer or NULL on failure, which means the verification error cannot
be returned to the caller.
Split the error handling for these reads into two - a failure to get
a buffer will still return NULL, but a read error will return a
referenced buffer with b_error set rather than NULL. The caller is
responsible for checking the error state of the buffer returned.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Phil White <pwhite@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r-- | fs/xfs/xfs_buf.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 0298dd68479..fbc965fc075 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
@@ -715,8 +715,7 @@ xfs_buf_read_uncached( | |||
715 | int flags, | 715 | int flags, |
716 | xfs_buf_iodone_t verify) | 716 | xfs_buf_iodone_t verify) |
717 | { | 717 | { |
718 | xfs_buf_t *bp; | 718 | struct xfs_buf *bp; |
719 | int error; | ||
720 | 719 | ||
721 | bp = xfs_buf_get_uncached(target, numblks, flags); | 720 | bp = xfs_buf_get_uncached(target, numblks, flags); |
722 | if (!bp) | 721 | if (!bp) |
@@ -730,11 +729,7 @@ xfs_buf_read_uncached( | |||
730 | bp->b_iodone = verify; | 729 | bp->b_iodone = verify; |
731 | 730 | ||
732 | xfsbdstrat(target->bt_mount, bp); | 731 | xfsbdstrat(target->bt_mount, bp); |
733 | error = xfs_buf_iowait(bp); | 732 | xfs_buf_iowait(bp); |
734 | if (error) { | ||
735 | xfs_buf_relse(bp); | ||
736 | return NULL; | ||
737 | } | ||
738 | return bp; | 733 | return bp; |
739 | } | 734 | } |
740 | 735 | ||