Skip to contentSkip to conversation

xfs: don't verify buffers after IO errors

PATCH Applied Dave Chinner 3 participants 5 messages Feb 27, 2013 – Mar 7, 2013 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: don't verify buffers after IO errors

From: Dave Chinner <[email protected]>

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.

---
 fs/xfs/xfs_buf.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/xfs/xfs_buf.c +3 -1
index 4e8f0df..50eb603 100644
@@ -1022,7 +1022,9 @@ xfs_buf_iodone_work(
 	bool			read = !!(bp->b_flags & XBF_READ);
 
 	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);
 
 	if (bp->b_iodone)
Signature · 6 lines
1.7.10

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dave Chinner

From: Dave Chinner<[email protected]>

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.

---

Looks good. needs to go into Linux 3.7/8 stable?

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw

Mark,

Quoted 8 lines · Mark Tinguely
Quoted 7 lines · Dave Chinner

From: Dave Chinner<[email protected]>

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.

Quoted 6 lines
Quoted 2 lines

---

Looks good. needs to go into Linux 3.7/8 stable?

$ git describe 1813dd64057490e7a0678a885c4fe6d02f78bdc1
v3.7-rc1-70-g1813dd6

3.7 and 3.8 is correct.

-Ben

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
In reply to Mark Tinguely
Quoted 8 lines · Mark Tinguely
Quoted 7 lines · Dave Chinner

From: Dave Chinner<[email protected]>

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.

Quoted 4 lines
Quoted 2 lines

---

Looks good. needs to go into Linux 3.7/8 stable?

It's not a critical fix - it just makes logs noisy and changes the error from, say, EIO to EFSCORRUPTED. The end result will be the same, though....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Applied
#4 lore raw
In reply to Dave Chinner
Quoted 8 lines · Dave Chinner

From: Dave Chinner <[email protected]>

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.

Applied.

-Ben

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs