From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Carlos Maiolino <cmaiolino@redhat.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/4] Get rid of XFS_BUF_PTR() macro
Date: Thu, 8 Mar 2018 00:15:27 -0800 [thread overview]
Message-ID: <20180308081527.GH15163@infradead.org> (raw)
In-Reply-To: <20180306222210.GL18129@dastard>
On Wed, Mar 07, 2018 at 09:22:10AM +1100, Dave Chinner wrote:
> On Tue, Mar 06, 2018 at 02:00:50PM +0100, Carlos Maiolino wrote:
> > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> .....
> > @@ -275,9 +275,9 @@ newfile(
> > d = XFS_FSB_TO_DADDR(mp, map.br_startblock);
> > bp = libxfs_trans_get_buf(logit ? tp : 0, mp->m_dev, d,
> > nb << mp->m_blkbb_log, 0);
> > - memmove(XFS_BUF_PTR(bp), buf, len);
> > + memmove(bp->b_addr, buf, len);
> > if (len < XFS_BUF_COUNT(bp))
> > - memset(XFS_BUF_PTR(bp) + len, 0, XFS_BUF_COUNT(bp) - len);
> > + memset(bp->b_addr + len, 0, XFS_BUF_COUNT(bp) - len);
>
> Bug there. pointer arithmetic changed, needs (char *) cast.
Not really. In standard C pointer arithmetics on void * isn't even
defined, so this won't work. In the GCC dialect it is defined the same
as on char *. And I'd much prefer not adding these pointless casts that
just confuse everyone.
next prev parent reply other threads:[~2018-03-08 8:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 13:00 [PATCH 0/4] Remove a few macros Carlos Maiolino
2018-03-06 13:00 ` [PATCH 1/4] Get rid of XFS_BUF_PTR() macro Carlos Maiolino
2018-03-06 22:22 ` Dave Chinner
2018-03-07 6:12 ` Carlos Maiolino
2018-03-08 8:15 ` Christoph Hellwig [this message]
2018-03-06 13:00 ` [PATCH 2/4] Get rid of XFS_BUF_TARGET() macro Carlos Maiolino
2018-03-08 8:15 ` Christoph Hellwig
2018-03-06 13:00 ` [PATCH 3/4] get rid of XFS_BUF_COUNT() macro Carlos Maiolino
2018-03-08 8:15 ` Christoph Hellwig
2018-03-06 13:00 ` [PATCH 4/4] Get rid of XFS_BUF_SET_COUNT() macro Carlos Maiolino
2018-03-08 8:16 ` Christoph Hellwig
2018-03-08 13:23 ` Carlos Maiolino
2018-03-14 13:05 ` [PATCH 0/4] Remove a few macros Carlos Maiolino
-- strict thread matches above, loose matches on Subject: below --
2018-03-07 9:05 [PATCH 0/4 V2] " Carlos Maiolino
2018-03-07 9:05 ` [PATCH 1/4] Get rid of XFS_BUF_PTR() macro Carlos Maiolino
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=20180308081527.GH15163@infradead.org \
--to=hch@infradead.org \
--cc=cmaiolino@redhat.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).