[Top] [All Lists]

Re: Possible small bug in xfsprogs-dev/db/metadump.c

To: Richard Sharpe <realrichardsharpe@xxxxxxxxx>
Subject: Re: Possible small bug in xfsprogs-dev/db/metadump.c
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Tue, 29 Sep 2009 09:00:22 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <46b8a8850909281036j1bdbf61h18b4134912735d92@xxxxxxxxxxxxxx>
References: <46b8a8850909271220w372d60c3s18a543ed00825082@xxxxxxxxxxxxxx> <20090928172137.GA21868@xxxxxxxxxxxxx> <46b8a8850909281036j1bdbf61h18b4134912735d92@xxxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Mon, Sep 28, 2009 at 10:36:13AM -0700, Richard Sharpe wrote:
> >
> > ? ? ? ?if (level == 0)
> > ? ? ? ? ? ? ? ?return 1;
> >
> > which should take care of the leaf nodes by exiting early.
> Well, yes there is, but that is the problem I encountered. It is level
> as passed in when starting at the top of the tree, which is obtained
> from the levels value in the AGF, and is decremented by one on each
> recursion:
>         if (!(*func)(iocur_top->data, agno, agbno, level - 1, btype, arg))
> However, what should really be looked at is the value bb_level in the
> header in each free-space Btree node.

I think bother are equally valid.  The one passed in fro mthe top should
always be right while the ondisk one might be corrupted.

> After I made that change to my changes, I started being able to
> properly count all leaf nodes and free extents, and the numbers came
> out where I expected them to be (instead of not seeing many leaf nodes
> and vastly undercounting free extents).

Still not quite understanding your problem here.  Do you have a tool
of your own that doesn't start from the btree root but only walks
subtrees?  In that case you need to look at the on-disk level unless
you can find out easily what level you start at.  But I don't think we
need this for the existing tools that always walk from the root.

> -- 
> Regards,
> Richard Sharpe
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs
---end quoted text---

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