Skip to content

Commit

Permalink
Fix full_name_hash() behaviour when length is a multiple of 8
Browse files Browse the repository at this point in the history
We want it to match what hash_name() is doing, which means extra
multiply by 9 in this case...

Reported-and-Tested-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Al Viro authored and torvalds committed Mar 22, 2012
1 parent ba331d5 commit f132c5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,10 +1439,10 @@ unsigned int full_name_hash(const unsigned char *name, unsigned int len)

for (;;) {
a = *(unsigned long *)name;
hash *= 9;
if (len < sizeof(unsigned long))
break;
hash += a;
hash *= 9;
name += sizeof(unsigned long);
len -= sizeof(unsigned long);
if (!len)
Expand Down

0 comments on commit f132c5b

Please sign in to comment.