Skip to contentSkip to conversation

xfs_repair: fix sibling pointer tests in verify_dir2_path()

PATCH In review Eric Sandeen 3 participants 3 messages Feb 19, 2014 – Feb 20, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_repair: fix sibling pointer tests in verify_dir2_path()

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:

Quoted 1 line

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.

---

repair/dir2.c +1 -1
index 3aabcaa..06dc000 100644
@@ -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

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Eric Sandeen

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:

Quoted 1 line

bad back pointer in block 8390324 for directory inode 131

Can you please wire this up for xfstests?

Quoted 10 lines

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.

Looks good,

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 5 lines · Eric Sandeen

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:

Quoted 1 line

bad back pointer in block 8390324 for directory inode 131

Can you please wire this up for xfstests?

was working on it, but am hitting something weird, we never hit ENOSPC when we hit maxicount; we keep creating inodes
but stop incrementing sb counters. Urk. (something in lazy
sb code...)

-Eric

Quoted 11 lines
Quoted 10 lines

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.

Quoted 9 lines

Looks good,

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs