Thread (25 messages) 25 messages, 2 authors, 2015-09-28

Re: [PATCH 06/11] xfs_repair: check v5 filesystem attr block header sanity

From: Dave Chinner <david@fromorbit.com>
Date: 2015-08-26 00:45:18

On Tue, Aug 25, 2015 at 05:32:59PM -0700, Darrick J. Wong wrote:
Check the v5 fields (uuid, blocknr, owner) of attribute blocks for
obvious errors while scanning xattr blocks.  If the ownership info
is incorrect, kill the block.

Signed-off-by: Darrick J. Wong <redacted>
Why hasn't the buffer verifier done this validation?
quoted hunk ↗ jump to hunk
@@ -1564,6 +1602,13 @@ process_longform_attr(
 	if (bp->b_error == -EFSBADCRC)
 		(*repair)++;
 
+	/* is this block sane? */
+	if (__check_attr_header(mp, bp, ino)) {
+		*repair = 0;
+		libxfs_putbuf(bp);
+		return 1;
+	}
As you can see the above hunk has a bad CRC check from the verifier,
and if the attr header is wrong then the verifier should be setting
bp->b_error == -EFSCORRUPTED.

So shouldn't this simply be:

+	if (bp->b_error == -EFSCORRUPTED) {
+		*repair = 0;
+		libxfs_putbuf(bp);
+		return 1;
+	}
+

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help