From: David Chinner <dgc@sgi.com>
To: Lachlan McIlroy <lachlan@sgi.com>
Cc: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: review: fix infinite loop in bulkstat
Date: Thu, 4 Oct 2007 16:21:59 +1000 [thread overview]
Message-ID: <20071004062159.GN995458@sgi.com> (raw)
In-Reply-To: <4704780C.2020100@sgi.com>
On Thu, Oct 04, 2007 at 03:20:12PM +1000, Lachlan McIlroy wrote:
> This fix prevents bulkstat from spinning in an infinite loop.
>
> Here 'agino' increments through the inodes in an allocation group.
> At the end of the innermost 'for' loop it will hold the value of the
> next inode to look at (ie the first inode in the next cluster/chunk).
> Assigning 'lastino' to 'agino' resets it to the last inode in the
> last inode cluster we just looked at. This causes us to look up
> the very same cluster and examine all the inodes all over again,
> and again, and again...
>
> We also want to set 'lastino' for the cases when we're not interested
> in the inode so that the next call to bulkstat wont re-examine the
> same uninteresting inodes.
Looks OK. I think you shoul dalso add a comment to the effect that
lastino needs to be set before continuing to process the next inode
in the loop so it doesn't get forgotten next time someone modifies
the code inside the loop..
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
prev parent reply other threads:[~2007-10-04 6:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-04 5:20 review: fix infinite loop in bulkstat Lachlan McIlroy
2007-10-04 6:21 ` David 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=20071004062159.GN995458@sgi.com \
--to=dgc@sgi.com \
--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