]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: fix sibling pointer tests in verify_dir2_path()
authorEric Sandeen <sandeen@redhat.com>
Sun, 23 Feb 2014 21:11:29 +0000 (08:11 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 23 Feb 2014 21:11:29 +0000 (08:11 +1100)
RH QE reported that if we create a 1G filesystem with default
options, mount it, and create inodes until full, then run
repair, repair reports corruption in verify_dir2_path() with:

> bad back pointer in block 8390324 for directory inode 131

The commit 88b32f0 xfs: add CRCs to dir2/da node blocks
had a small error which regressed this; although we switch
to the "newnode," to check sibling pointers, we re-populate
the node hdr with the old "node" data.  This causes the
backpointer test to be testing the wrong node's values.

Fixing this bug fixes the testcase.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/dir2.c

index 3aabcaa1b817ecf9e2d471cae53f786f623cd701..06dc0008cd67c6c171263b833ae7045dbc16681d 100644 (file)
@@ -552,7 +552,7 @@ _("can't read block %u for directory inode %" PRIu64 "\n"),
 
                newnode = bp->b_addr;
                btree = xfs_da3_node_tree_p(newnode);
-               xfs_da3_node_hdr_from_disk(&nodehdr, node);
+               xfs_da3_node_hdr_from_disk(&nodehdr, newnode);
                /*
                 * verify magic number and back pointer, sanity-check
                 * entry count, verify level