summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-12-07 17:02:47 +0000
committerGrant Likely <grant.likely@secretlab.ca>2012-12-07 17:02:47 +0000
commit7730cba2a50332c194f50a58b86359ea39a82bd1 (patch)
tree64c8d7228da1454c02288068e57a9c61f8b0acd0 /fs/xfs/xfs_buf.c
parentc20151dff8a6d503c0d0cc4387c33a618cdabcb7 (diff)
parentb69f0859dc8e633c5d8c06845811588fe17e68b3 (diff)
downloadblackbird-op-linux-7730cba2a50332c194f50a58b86359ea39a82bd1.tar.gz
blackbird-op-linux-7730cba2a50332c194f50a58b86359ea39a82bd1.zip
Merge tag 'v3.7-rc8' into spi/next
Linux 3.7-rc8
Diffstat (limited to 'fs/xfs/xfs_buf.c')
-rw-r--r--fs/xfs/xfs_buf.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 933b7930b863..4b0b8dd1b7b0 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1197,9 +1197,14 @@ xfs_buf_bio_end_io(
{
xfs_buf_t *bp = (xfs_buf_t *)bio->bi_private;
- xfs_buf_ioerror(bp, -error);
+ /*
+ * don't overwrite existing errors - otherwise we can lose errors on
+ * buffers that require multiple bios to complete.
+ */
+ if (!bp->b_error)
+ xfs_buf_ioerror(bp, -error);
- if (!error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ))
+ if (!bp->b_error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ))
invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp));
_xfs_buf_ioend(bp, 1);
@@ -1279,6 +1284,11 @@ next_chunk:
if (size)
goto next_chunk;
} else {
+ /*
+ * This is guaranteed not to be the last io reference count
+ * because the caller (xfs_buf_iorequest) holds a count itself.
+ */
+ atomic_dec(&bp->b_io_remaining);
xfs_buf_ioerror(bp, EIO);
bio_put(bio);
}
OpenPOWER on IntegriCloud