From: Viacheslav Dubeyko <slava@dubeyko.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Chengyu Song <csong84@gatech.edu>,
Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
Al Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] hfs: fix hfs_readdir()
Date: Mon, 16 Jan 2017 22:34:54 +0000 [thread overview]
Message-ID: <1484606094.27533.35.camel@dubeyko.com> (raw)
In-Reply-To: <20170116142211.GF4104@mwanda>
On Mon, 2017-01-16 at 17:22 +0300, Dan Carpenter wrote:
> I was reviewing old warnings and I stumbled across this one again.
> Although I wrote that &fd.key->cat and "fd.key" are equivalent, I
> feel
> that actually we should be doing the former. fd.key is a union but
> we
> want the ->cat member of the union.
>
> On Tue, Jan 26, 2016 at 01:54:06PM -0800, Viacheslav Dubeyko wrote:
> >
> > On Tue, 2016-01-26 at 22:18 +0300, Dan Carpenter wrote:
> > >
> > > Hm, I completely didn't see that it was a union instead of a
> > > struct. I
> > > still think my fix is actually correct though. Now that you
> > > point out
> > > the union, I see that my change is equivalent to just removing
> > > the '&'
> > > char.
> > >
> > > - memcpy(&rd->key, &fd.key, sizeof(struct hfs_cat_key));
> > > + memcpy(&rd->key, fd.key, sizeof(struct hfs_cat_key));
> > >
> > Yeahh, it looks correct right now. The rd is the pointer that
> > includes
> > struct hfs_cat_key object. So, we need to use &rd->key. But on
> > another
> > side we have struct hfs_find_data object on the stack. And this
> > object
> > includes the pointer on union btree_key. We want to copy struct
> > hfs_cat_key object and we should use sizeof(struct hfs_cat_key).
> I've read this paragraph several times now and I think you are saying
> that the patch is correct.
>
Yes, I've said that patch looks good. I think it's better to resend the
patch again.
Thanks,
Vyacheslav Dubeyko.
next prev parent reply other threads:[~2017-01-16 22:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-26 9:26 [patch] hfs: fix hfs_readdir() Dan Carpenter
2016-01-26 18:18 ` Viacheslav Dubeyko
2016-01-26 19:18 ` Dan Carpenter
2016-01-26 21:54 ` Viacheslav Dubeyko
2017-01-16 14:22 ` Dan Carpenter
2017-01-16 22:34 ` Viacheslav Dubeyko [this message]
2017-01-18 11:13 ` [patch resend] hfs: fix " Dan Carpenter
2017-01-18 17:28 ` Viacheslav Dubeyko
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=1484606094.27533.35.camel@dubeyko.com \
--to=slava@dubeyko.com \
--cc=akpm@linux-foundation.org \
--cc=csong84@gatech.edu \
--cc=dan.carpenter@oracle.com \
--cc=dhowells@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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