From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/4] xfs: refactor xlog_recover_process_data()
Date: Tue, 26 Aug 2014 14:55:09 +1000 [thread overview]
Message-ID: <20140826045509.GI20518@dastard> (raw)
In-Reply-To: <20140826040921.GA9591@infradead.org>
On Mon, Aug 25, 2014 at 09:09:21PM -0700, Christoph Hellwig wrote:
> > @@ -3556,14 +3622,10 @@ xlog_recover_process_data(
> > xfs_caddr_t dp,
> > int pass)
> > {
> > + struct xlog_op_header *ohead;
> > xfs_caddr_t lp;
> > int num_logops;
> > int error;
> >
> > lp = dp + be32_to_cpu(rhead->h_len);
> > num_logops = be32_to_cpu(rhead->h_num_logops);
> > @@ -3573,69 +3635,24 @@ xlog_recover_process_data(
> > return -EIO;
> >
> > while ((dp < lp) && num_logops) {
> > + ASSERT(dp + sizeof(struct xlog_op_header) <= lp);
> > +
> > + ohead = (struct xlog_op_header *)dp;
> > + dp += sizeof(*ohead);
>
> Using sizeof type and sizeof variable for the same thing right next
> to each other seems weird. Also why duplicate the addition instead
> of moving it below the assignment:
Oh, I missed converting the one in the ASSERT.
> ohead = (struct xlog_op_header *)dp;
> dp += sizeof(*ohead);
>
> ASSERT(dp <= lp);
Yup, that makes sense.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-08-26 4:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 1:21 [RFC, PATCH 0/4] xfs: clean up xlog_recover_process_data Dave Chinner
2014-08-26 1:21 ` [PATCH 1/4] xfs: refactor xlog_recover_process_data() Dave Chinner
2014-08-26 4:09 ` Christoph Hellwig
2014-08-26 4:55 ` Dave Chinner [this message]
2014-08-26 12:41 ` Brian Foster
2014-08-26 22:34 ` Dave Chinner
2014-08-27 11:19 ` Brian Foster
2014-08-28 0:47 ` Dave Chinner
2014-08-26 1:21 ` [PATCH 2/4] xfs: recovery of XLOG_UNMOUNT_TRANS leaks memory Dave Chinner
2014-08-26 12:41 ` Brian Foster
2014-08-26 1:21 ` [PATCH 3/4] xfs: fix double free in xlog_recover_commit_trans Dave Chinner
2014-08-26 12:42 ` Brian Foster
2014-08-26 1:21 ` [PATCH 4/4] xfs: reorganise transaction recovery item code Dave Chinner
2014-08-26 12:40 ` [RFC, PATCH 0/4] xfs: clean up xlog_recover_process_data Brian Foster
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=20140826045509.GI20518@dastard \
--to=david@fromorbit.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