1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
From 9f0fe583ffc5116584d8c4800a7fa28bb4ff9b09 Mon Sep 17 00:00:00 2001
From: Liang Li <liang.li@windriver.com>
Date: Thu, 16 Aug 2012 21:25:01 +0800
Subject: [PATCH] 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 <liang.li@windriver.com>
---
fs/namei.c | 6 ++----
1 files 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.5.4
|