public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Lachlan McIlroy <lachlan@sgi.com>
Cc: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: REVIEW: xfs_bmap_check_leaf_extents() can reference unmapped memory
Date: Thu, 20 Mar 2008 03:55:27 -0400	[thread overview]
Message-ID: <20080320075527.GA24999@infradead.org> (raw)
In-Reply-To: <47E2000B.9030208@sgi.com>

On Thu, Mar 20, 2008 at 05:11:23PM +1100, Lachlan McIlroy wrote:
> +	xfs_bmbt_rec_t		last;   /* last extent in previous block */
>  	xfs_bmbt_rec_t		*nextp;	/* pointer to next extent */
>  	int			bp_release = 0;
>
> @@ -6264,7 +6264,6 @@ xfs_bmap_check_leaf_extents(
>  	/*
>  	 * Loop over all leaf nodes checking that all extents are in the right order.
>  	 */
>  	for (;;) {
>  		xfs_fsblock_t	nextbno;
>  		xfs_extnum_t	num_recs;
> @@ -6285,18 +6284,18 @@ xfs_bmap_check_leaf_extents(
>  		 */
>
>  		ep = XFS_BTREE_REC_ADDR(xfs_bmbt, block, 1);
> +		if (i) {
> +			xfs_btree_check_rec(XFS_BTNUM_BMAP, (void *)&last,
> +				(void *)ep);

I haven't actually compiled this yet, but I'd expect this to give an
unitialized variable warning with gcc because it can't figure out this
can't happen in the first loop iteration.  You might need and
last = { 0, } somewhere in the beginning of the function.

Also I think the void * casts above are useless.

>  			xfs_btree_check_rec(XFS_BTNUM_BMAP, (void *)ep,
>  				(void *)(nextp));

and at that point you might fix these up aswell, with the added benefit
that now the whole call fits on a single line.

      reply	other threads:[~2008-03-20  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-20  6:11 REVIEW: xfs_bmap_check_leaf_extents() can reference unmapped memory Lachlan McIlroy
2008-03-20  7:55 ` Christoph Hellwig [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=20080320075527.GA24999@infradead.org \
    --to=hch@infradead.org \
    --cc=lachlan@sgi.com \
    --cc=xfs-dev@sgi.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