From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: Leon Romanovsky <leon@leon.nu>, Fubo Chen <fubo.chen@gmail.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
Namjae Jeon <namjae.jeon@samsung.com>,
Amit Sahrawat <a.sahrawat@samsung.com>
Subject: Re: [PATCH] f2fs: fix up f2fs_get_parent issue to retrieve correct parent inode number
Date: Thu, 13 Dec 2012 09:14:11 +0900 [thread overview]
Message-ID: <1355357651.24219.21.camel@kjgkr> (raw)
In-Reply-To: <CAKYAXd-3tvx4feHO5z_2p4FAMS8CvUDVKngh=R178TL4YASadQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]
2012-12-13 (목), 07:44 +0900, Namjae Jeon:
> 2012/12/13, Leon Romanovsky <leon@leon.nu>:
> > On Wed, Dec 12, 2012 at 8:50 AM, Fubo Chen <fubo.chen@gmail.com> wrote:
> >> On Wed, Dec 12, 2012 at 5:12 PM, Leon Romanovsky <leon@leon.nu> wrote:
> >>> On Wed, Dec 12, 2012 at 7:05 AM, Fubo Chen <fubo.chen@gmail.com> wrote:
> >>>>
> >>>> On Wed, Dec 12, 2012 at 3:37 PM, Namjae Jeon <linkinjeon@gmail.com>
> >>>> wrote:
> >>>> > + /* dot and dotdot dentries should have zero-value hash code
> >>>> > */
> >>>> > + if (!memcmp(name, ".", 1) || !memcmp(name, "..", 2))
> >>>> > + return 0;
> >>>>
> >>>> That looks suspicious. If memcmp(name, "..", 2) == 0 then always
> >>>> memcmp(name, ".", 1) == 0. Why two tests ?
> >>>
> >>> It is not the case vice versa, so you still need to do two checks.
> >>> You need to distinguish dot(.), dotdot(..) and something with dot at
> >>> the beginning (for example - .o)
> >>
> >> Thanks for replying. I understand that the intention is what you
> >> explained. But to me the code says something else: "if the first byte
> >> of name is a dot, return 0". Did I see that correctly ?
> > Excellent catch, I agree with you It will also return 0 for every file
> > which starts from the dot.
> > The right solution must take name length into account.
> Hi.
> Agree. I will change it on v2 patch.
> Thanks for review.
Nice catch!
I made a mistake initially before. Sorry Namjae.
Thanks to all of you.
--
Jaegeuk Kim
Samsung
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-12-13 0:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 14:37 Namjae Jeon
2012-12-12 15:05 ` Fubo Chen
2012-12-12 16:12 ` Leon Romanovsky
2012-12-12 16:50 ` Fubo Chen
2012-12-12 17:12 ` Leon Romanovsky
2012-12-12 22:44 ` Namjae Jeon
2012-12-13 0:14 ` Jaegeuk Kim [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-12-11 15:10 Namjae Jeon
2012-12-12 0:33 ` Jaegeuk Kim
2012-12-12 0:48 ` Namjae Jeon
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=1355357651.24219.21.camel@kjgkr \
--to=jaegeuk.kim@samsung.com \
--cc=a.sahrawat@samsung.com \
--cc=fubo.chen@gmail.com \
--cc=leon@leon.nu \
--cc=linkinjeon@gmail.com \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namjae.jeon@samsung.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
all inboxes | Powered by JetHome®