public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_repair: fix sibling pointer tests in verify_dir2_path()
@ 2014-02-19 21:10 Eric Sandeen
  2014-02-20 15:41 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sandeen @ 2014-02-19 21:10 UTC (permalink / raw)
  To: xfs-oss

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>
---

diff --git a/repair/dir2.c b/repair/dir2.c
index 3aabcaa..06dc000 100644
--- a/repair/dir2.c
+++ b/repair/dir2.c
@@ -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
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs_repair: fix sibling pointer tests in verify_dir2_path()
  2014-02-19 21:10 [PATCH] xfs_repair: fix sibling pointer tests in verify_dir2_path() Eric Sandeen
@ 2014-02-20 15:41 ` Christoph Hellwig
  2014-02-20 19:12   ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2014-02-20 15:41 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-oss

On Wed, Feb 19, 2014 at 03:10:13PM -0600, Eric Sandeen wrote:
> 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

Can you please wire this up for xfstests?

> 
> 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>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfs_repair: fix sibling pointer tests in verify_dir2_path()
  2014-02-20 15:41 ` Christoph Hellwig
@ 2014-02-20 19:12   ` Eric Sandeen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2014-02-20 19:12 UTC (permalink / raw)
  To: Christoph Hellwig, Eric Sandeen; +Cc: xfs-oss

On 2/20/14, 9:41 AM, Christoph Hellwig wrote:
> On Wed, Feb 19, 2014 at 03:10:13PM -0600, Eric Sandeen wrote:
>> 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
> 
> 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

>>
>> 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>
> 
> Looks good,
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-20 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-19 21:10 [PATCH] xfs_repair: fix sibling pointer tests in verify_dir2_path() Eric Sandeen
2014-02-20 15:41 ` Christoph Hellwig
2014-02-20 19:12   ` Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox