public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Lachlan McIlroy <lmcilroy@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 5/9] xfs: do not use unchecked extent indices in xfs_bmapi
Date: Thu, 12 May 2011 03:20:58 -0400 (EDT)	[thread overview]
Message-ID: <1935452012.471482.1305184858098.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <20110511150712.222802741@bombadil.infradead.org>

Looks good.

----- Original Message -----
> Make sure to only call xfs_iext_get_ext after we've validate the
> extent index
> when moving on to the next index in xfs_bmapi.
> 
> Based on an earlier patch from Lachlan McIlroy.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: xfs/fs/xfs/xfs_bmap.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_bmap.c 2011-05-11 10:16:58.831733512 +0200
> +++ xfs/fs/xfs/xfs_bmap.c 2011-05-11 10:16:58.847733078 +0200
> @@ -4827,12 +4827,13 @@ xfs_bmapi(
> /*
> * Else go on to the next record.
> */
> - ep = xfs_iext_get_ext(ifp, ++lastx);
> prev = got;
> - if (lastx >= nextents)
> - eof = 1;
> - else
> + if (++lastx < nextents) {
> + ep = xfs_iext_get_ext(ifp, lastx);
> xfs_bmbt_get_all(ep, &got);
> + } else {
> + eof = 1;
> + }
> }
> *nmap = n;
> /*
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

  reply	other threads:[~2011-05-12  7:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11 15:04 [PATCH 0/9] extent buffer indexing fixes Christoph Hellwig
2011-05-11 15:04 ` [PATCH 1/9] xfs: remove the unused XFS_BMAPI_RSVBLOCKS flag Christoph Hellwig
2011-05-20 20:17   ` Alex Elder
2011-05-11 15:04 ` [PATCH 2/9] xfs: remove if_lastex Christoph Hellwig
2011-05-20 20:17   ` Alex Elder
2011-05-23  8:52   ` [PATCH 2/9 v2] " Christoph Hellwig
2011-05-25  1:14     ` Alex Elder
2011-05-11 15:04 ` [PATCH 3/9] xfs: correctly decrement the extent buffer index in xfs_bmap_del_extent Christoph Hellwig
2011-05-12  6:50   ` Lachlan McIlroy
2011-05-12  6:54     ` Lachlan McIlroy
2011-05-12  7:17   ` Lachlan McIlroy
2011-05-25  0:27   ` Alex Elder
2011-05-11 15:04 ` [PATCH 4/9] xfs: do not use unchecked extent indices in xfs_bmap_add_extent_* Christoph Hellwig
2011-05-12  7:31   ` Lachlan McIlroy
2011-05-25  0:30   ` Alex Elder
2011-05-11 15:04 ` [PATCH 5/9] xfs: do not use unchecked extent indices in xfs_bmapi Christoph Hellwig
2011-05-12  7:20   ` Lachlan McIlroy [this message]
2011-05-25  0:31   ` Alex Elder
2011-05-11 15:04 ` [PATCH 6/9] xfs: do not use unchecked extent indices in xfs_bunmapi Christoph Hellwig
2011-05-12  7:22   ` Lachlan McIlroy
2011-05-25  0:31   ` Alex Elder
2011-05-11 15:04 ` [PATCH 7/9] xfs: do not do pointer arithmetics on extent records Christoph Hellwig
2011-05-12  7:23   ` Lachlan McIlroy
2011-05-25  0:31   ` Alex Elder
2011-05-11 15:04 ` [PATCH 8/9] xfs: fix up asserts in xfs_iflush_fork Christoph Hellwig
2011-05-12  7:24   ` Lachlan McIlroy
2011-05-25  0:32   ` Alex Elder
2011-05-11 15:04 ` [PATCH 9/9] xfs: check for valid indices in xfs_iext_get_ext and xfs_iext_idx_to_irec Christoph Hellwig
2011-05-12  7:26   ` Lachlan McIlroy
2011-05-25  0:32   ` Alex Elder

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=1935452012.471482.1305184858098.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com \
    --to=lmcilroy@redhat.com \
    --cc=hch@infradead.org \
    --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