From be59c0838d25c4a51951070ee236f064af538b97 Mon Sep 17 00:00:00 2001 From: Liang Li Date: Thu, 16 Aug 2012 21:25:01 +0800 Subject: [PATCH 4/5] unionfs: update unionfs fork to align with mainline mainline commit 0145acc [vfs: uninline full_name_hash] changes the interface to full_name_hash, so unionfs fork must be updated. Otherwise unionfs might have the odd behavior that newly created directories/files in unionfs won't show up in underlying fs properly. This also implies that 0145acc fixes the corner issue/regression that introduced by mainline commit bfcfaa7 [vfs: use 'unsigned long' accesses for dcache name comparison and hashing] and e419b4c [vfs: make word-at-a-time accesses handle a non-existing page], that newly adopted fast hash function might have hash collision issue on x86. Signed-off-by: Liang Li --- fs/namei.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index de81292..afb6cc8 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1889,7 +1889,6 @@ struct dentry *lookup_one_len_nd(const char *name, struct dentry *base, int len, struct nameidata *nd) { struct qstr this; - unsigned long hash; unsigned int c; WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex)); @@ -1899,14 +1898,13 @@ struct dentry *lookup_one_len_nd(const char *name, struct dentry *base, if (!len) return ERR_PTR(-EACCES); - hash = init_name_hash(); + this.hash = full_name_hash(name, len); + while (len--) { c = *(const unsigned char *)name++; if (c == '/' || c == '\0') return ERR_PTR(-EACCES); - hash = partial_name_hash(c, hash); } - this.hash = end_name_hash(hash); /* * See if the low-level filesystem might want * to use its own hash.. -- 1.7.10.4