Explorar o código

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>
Dave Chinner %!s(int64=12) %!d(string=hai) anos
pai
achega
d5929de833
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      fs/xfs/xfs_buf.c

+ 3 - 1
fs/xfs/xfs_buf.c

@@ -1022,7 +1022,9 @@ xfs_buf_iodone_work(
 	bool			read = !!(bp->b_flags & XBF_READ);
 	bool			read = !!(bp->b_flags & XBF_READ);
 
 
 	bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_READ_AHEAD);
 	bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_READ_AHEAD);
-	if (read && bp->b_ops)
+
+	/* only validate buffers that were read without errors */
+	if (read && bp->b_ops && !bp->b_error && (bp->b_flags & XBF_DONE))
 		bp->b_ops->verify_read(bp);
 		bp->b_ops->verify_read(bp);
 
 
 	if (bp->b_iodone)
 	if (bp->b_iodone)