From: Eric Sandeen Date: Tue, 13 Oct 2015 23:31:48 +0000 (+1100) Subject: xfs_repair: better checking of v5 attributes X-Git-Tag: v4.3.0-rc1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08724aa7faf97b62c5cba34365569bfb7f715894;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: better checking of v5 attributes The commit: 0519f66 xfs_repair: better checking of v5 metadata fields added new corruption checks to dir2.c but missed the similar code in attr_repair.c; add that here. Signed-off-by: Eric Sandeen Signed-off-by: Eric Sandeen Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- diff --git a/repair/attr_repair.c b/repair/attr_repair.c index 2aafdf65b..c8ba48413 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -201,6 +201,15 @@ traverse_int_dablock(xfs_mount_t *mp, goto error_out; } + /* corrupt node; rebuild the dir. */ + if (bp->b_error == -EFSBADCRC || bp->b_error == -EFSCORRUPTED) { + libxfs_putbuf(bp); + do_warn( +_("corrupt tree block %u for directory inode %" PRIu64 "\n"), + bno, da_cursor->ino); + goto error_out; + } + if (nodehdr.count > geo->node_ents) { do_warn(_("bad record count in inode %" PRIu64 ", " "count = %d, max = %d\n"),