From a418fe7dba54d060f0298f69a41418b464e7dfa7 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 19 Aug 2016 10:52:41 +1000 Subject: [PATCH] xfs_repair: check for impossible rmap record field combinations Make sure there are no records or keys with impossible field combinations, such as non-inode records with offsets or flags. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- repair/scan.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/repair/scan.c b/repair/scan.c index 807a23694..9a46dd053 100644 --- a/repair/scan.c +++ b/repair/scan.c @@ -1011,6 +1011,18 @@ _("%s rmap btree block claimed (state %d), agno %d, bno %d, suspect %d\n"), _("invalid owner in rmap btree record %d (%"PRId64" %u) block %u/%u\n"), i, owner, len, agno, bno); + /* Look for impossible record field combinations. */ + if (XFS_RMAP_NON_INODE_OWNER(key.rm_owner)) { + if (key.rm_flags) + do_warn( + _("record %d of block (%u/%u) in %s btree cannot have non-inode owner with flags\n"), + i, agno, bno, name); + if (key.rm_offset) + do_warn( + _("record %d of block (%u/%u) in %s btree cannot have non-inode owner with offset\n"), + i, agno, bno, name); + } + /* Check for out of order records. */ if (i == 0) { advance: -- 2.50.1