From: Dave Chinner <david@fromorbit.com>
To: Peter Watkins <treestem@gmail.com>
Cc: xfs@oss.sgi.com
Subject: Re: xfs_db: bug in bmap command?
Date: Fri, 3 Aug 2012 12:37:11 +1000 [thread overview]
Message-ID: <20120803023711.GR2877@dastard> (raw)
In-Reply-To: <20120802233025.GP2877@dastard>
On Fri, Aug 03, 2012 at 09:30:25AM +1000, Dave Chinner wrote:
> > diff --git a/db/bmap.c b/db/bmap.c
> > index ddad49c..0ef7a62 100644
> > --- a/db/bmap.c
> > +++ b/db/bmap.c
> > @@ -101,9 +101,9 @@ bmap(
> > block = (struct xfs_btree_block *)iocur_top->data;
> > if (be16_to_cpu(block->bb_level) == 0)
> > break;
> > - pp = XFS_BMDR_PTR_ADDR(block, 1,
> > + pp = XFS_BMBT_PTR_ADDR(mp, block, 1,
> > xfs_bmbt_maxrecs(mp, mp->m_sb.sb_blocksize, 0));
> > - kp = XFS_BMDR_KEY_ADDR(block, 1);
> > + kp = XFS_BMBT_KEY_ADDR(mp, block, 1);
>
> That, I'm pretty sure, is wrong, too, because the root block is a
> different format to the tree blocks. IOWs,the old code parses
> tree node blocks with the root block format macro, while your code
> parses the root node with tree block format macros. Both are wrong.
> The original was also wrong in that it used xfs_bmbt_maxrecs()
> instead of xfs_bmdr_maxrecs() for the number of records in the inode
> root block.
Ignore this, I misread the code in bmap(). the root block is already
dealt with before entering the first loop, so it will never come
across the root block and so have to handle it. My mistake, the
patch as is should work just fine.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2012-08-03 2:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-01 15:17 xfs_db: bug in bmap command? Peter Watkins
2012-08-02 22:19 ` Eric Sandeen
2012-08-02 22:26 ` Eric Sandeen
2012-08-02 23:31 ` Dave Chinner
2012-08-02 23:30 ` Dave Chinner
2012-08-03 2:37 ` Dave Chinner [this message]
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=20120803023711.GR2877@dastard \
--to=david@fromorbit.com \
--cc=treestem@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