2012/12/13, Leon Romanovsky <l...@leon.nu>:
> On Wed, Dec 12, 2012 at 8:50 AM, Fubo Chen <fubo.c...@gmail.com> wrote:
>> On Wed, Dec 12, 2012 at 5:12 PM, Leon Romanovsky <l...@leon.nu> wrote:
>>> On Wed, Dec 12, 2012 at 7:05 AM, Fubo Chen <fubo.c...@gmail.com> wrote:
>>>>
>>>> On Wed, Dec 12, 2012 at 3:37 PM, Namjae Jeon <linkinj...@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.
>
>>
>> Fubo.
>
>
>
> --
> Leon Romanovsky | Independent Linux Consultant
>         www.leon.nu | l...@leon.nu
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to