public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Richard Sharpe <realrichardsharpe@gmail.com>
Cc: xfs@oss.sgi.com
Subject: Re: Possible small bug in xfsprogs-dev/db/metadump.c
Date: Mon, 28 Sep 2009 13:21:37 -0400	[thread overview]
Message-ID: <20090928172137.GA21868@infradead.org> (raw)
In-Reply-To: <46b8a8850909271220w372d60c3s18a543ed00825082@mail.gmail.com>

[Cc'ed to the list, where people including the most active person on the
 userspace side hang out]

On Sun, Sep 27, 2009 at 12:20:33PM -0700, Richard Sharpe wrote:
> Hi folks,
> 
> There seems to be a small bug in
> xfsprogs-dev/db/metadump.c:scanfunc_freesp (although I think the same
> problem exists in other functions).
> 
> It has a check to see if the number of records is invalid:
> 
>         numrecs = be16_to_cpu(block->bb_numrecs);
>         if (numrecs > mp->m_alloc_mxr[1]) {
>                 if (show_warnings)
>                         print_warning("invalid numrecs (%u) in %s block %u/%u",
>                                 numrecs, typtab[btype].name, agno, agbno);
>                 return 1;
>         }
> 
> However, it seems to me that you should pay attention to bb_level in
> the node when using that test, because leaf nodes can appear at
> multiple levels in the tree.

Before that code there is a

	if (level == 0)
		return 1;

which should take care of the leaf nodes by exiting early.

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

       reply	other threads:[~2009-09-28 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <46b8a8850909271220w372d60c3s18a543ed00825082@mail.gmail.com>
2009-09-28 17:21 ` Christoph Hellwig [this message]
2009-09-28 17:36   ` Possible small bug in xfsprogs-dev/db/metadump.c Richard Sharpe
2009-09-29 13:00     ` Christoph Hellwig
2009-09-29 15:45       ` Richard Sharpe
2009-09-30  0:16         ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090928172137.GA21868@infradead.org \
    --to=hch@infradead.org \
    --cc=realrichardsharpe@gmail.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox