aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-02-26 21:25:54 -0500
committerBen Myers <bpm@sgi.com>2013-03-07 13:31:02 -0500
commitd5929de8337fef46f3e307914ed0f3cb845e66c1 (patch)
treea305ce6faa2c04b8a29801e9a04e6772b63caaf0 /fs/xfs
parente8108cedb1c5d1dc359690d18ca997e97a0061d2 (diff)
xfs: don't verify buffers after IO errors
When we read a buffer, we might get an error from the underlying block device and not the real data. Hence if we get an IO error, we shouldn't run the verifier but instead just pass the IO error straight through. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_buf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 4e8f0df82d02..50eb603e0cc1 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1022,7 +1022,9 @@ xfs_buf_iodone_work(
1022 bool read = !!(bp->b_flags & XBF_READ); 1022 bool read = !!(bp->b_flags & XBF_READ);
1023 1023
1024 bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_READ_AHEAD); 1024 bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_READ_AHEAD);
1025 if (read && bp->b_ops) 1025
1026 /* only validate buffers that were read without errors */
1027 if (read && bp->b_ops && !bp->b_error && (bp->b_flags & XBF_DONE))
1026 bp->b_ops->verify_read(bp); 1028 bp->b_ops->verify_read(bp);
1027 1029
1028 if (bp->b_iodone) 1030 if (bp->b_iodone)