xfs
[Top] [All Lists]

Re: Oops in xfs_dir2_block_lookup_int from storage corruption [2.6.33]

To: Simon Kirby <sim@xxxxxxxxxx>
Subject: Re: Oops in xfs_dir2_block_lookup_int from storage corruption [2.6.33]
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 7 Apr 2010 08:36:38 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20100404081657.GA24143@xxxxxxxxxx>
References: <20100404081657.GA24143@xxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Sun, Apr 04, 2010 at 01:16:57AM -0700, Simon Kirby wrote:
>         /*
>          * Loop doing a binary search for our hash value.
>          * Find our entry, ENOENT if it's not there.
>          */
>         for (low = 0, high = be32_to_cpu(btp->count) - 1; ; ) {
>                 ASSERT(low <= high);
>                 mid = (low + high) >> 1;
> ======>         if ((hash = be32_to_cpu(blp[mid].hashval)) == args->hashval)
>                         break;
> 
> blp is 8 bytes which matches the multiplication of the array index in the
> instruction.  So, this means that blp[mid] pointed to 0xffff8800f674bf00,
> and mid was 0x0000000015c6535e.  That sounds kind of high...?

Yes. Looks like btp->count was corrupted.  It counts the number of
xfs_dir2_leaf_entry in the directory block, which is 16 bytes larger.
So with 4k directory blocks that you're using we could only pack 256
entries in one block, and that's already disconting the head and tail
headers we have in the block format.

I'll add some more error checking to the directory code when I get
time for it.

<Prev in Thread] Current Thread [Next in Thread>