Re: [PATCH 1/2] repair: fix the variable-width nlink array

Christoph Hellwig
2012-03-02T07:44:42Z

On Thu, Mar 01, 2012 at 03:28:22PM -0600, Ben Myers wrote:
> Hey Christoph,
>
> On Tue, Feb 28, 2012 at 12:42:24PM -0500, Christoph Hellwig wrote:
> > It looks like we currently never grow the variable-width nlink array
> > if only the on-disk nlink size overflows 8 bits. This leads to a major
> > mess in nlink counting, and eventually an assert in phase7.
> >
> > Replace the indirect all mess with a union that allows doing proper
> > array arithmetics while we're at it.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> This looks good to me. I enjoyed the fallthrus in set_inode_disk_nlinks
> and add_inode_ref.
>
> I haven't tested with this many links though... Are there any xfstests
> that would exercise this?

There is none yet. I've tested it with Arekm's test metadump, which
I've added to my nasty images collection. I'll create a testcase
reproducing this artifically.

> On my machine test 030 has regressed. It passed on 3.1.7.

That's an older change. I have a fix in my local tree, but it needs
polishing so that it still works with older repair versions.