If reading the root block of an extended attribute structure fails due
to a corruption error, we should junk the block since we know it's bad.
There's no point in moving on to the (rather insufficient) checks in the
attr code.
Found by fuzzing hdr.freemap[1].base = ones in xfs/400.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
ino);
return 1;
}
+
+ if (bp->b_error == -EFSCORRUPTED) {
+ do_warn(
+ _("corrupt block 0 of inode %" PRIu64 " attribute fork\n"),
+ ino);
+ libxfs_buf_relse(bp);
+ return 1;
+ }
+
if (bp->b_error == -EFSBADCRC)
(*repair)++;