Messages in this thread | | | Date | Wed, 12 Dec 2012 17:50:16 +0100 | Subject | Re: [PATCH] f2fs: fix up f2fs_get_parent issue to retrieve correct parent inode number | From | Fubo Chen <> |
| |
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 ?
Fubo.
| |