[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFyiNKdkkvK0FH1ibo1iJj1HF9RjLEw3VOEjVwc0eiX8Sw@mail.gmail.com>
Date: Thu, 22 Mar 2012 13:38:28 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: linux-kernel@...r.kernel.org, xen-devel@...ts.xensource.com,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: Re: Regression introduced by bfcfaa77bdf0f775263e906015982a608df01c76
(vfs: use 'unsigned long' accesses for dcache name comparison and hashing)
On Thu, Mar 22, 2012 at 1:24 PM, Al Viro <viro@...iv.linux.org.uk> wrote:
>
> OK, full_name_hash()/hash_name() definitely have a mismatch and it's on the
> names of length 8*n: trivial experiment shows that we have
> name hash_name full_name_hash
Good catch, guys.
Ugh. And I never noticed despite having run this code on my machines
for several weeks, because I don't think I have anything that uses the
"full_name_hash()" function. And it looked so obviously the same.
> Linus, which way do you prefer to shift it? Should hash_name() change to
> match full_name_hash() or should it be the other way round?
>
> What happens is that you get multiplication by 9 and adding 0 in the former,
> after having added the last full word. In the latter we add the last full
> word, see that there's nothing left and bugger off.
Yes. I think we should make things match "hash_name()", because that's
the one that is critical and we want to really generate good code for.
I think you can just move the "*=9" down in full_name_hash(), so that
we always "pre-multiply" the hash for the next round. But I'll have
to double-check my logic.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists