[PATCH] fs/namei.c: Update !CONFIG_DCACHE_WORD_ACCESS case
From: George Spelvin
Date: Sun May 29 2016 - 01:23:14 EST
A couple of late changes to the previous patch didn't update the
!CONFIG_DCACHE_WORD_ACCESS option correspondingly. It hadn't
changed, so didn't need re-testing, right?
Yeah. Let that be a lesson to me.
Specifically the caller got changed in two ways:
- The function name was changed from v1 to avoid a collision.
- The self-test was updated to cover zero-length strings; the function
needs to be updated, too.
Signed-off-by: George Spelvin <linux@xxxxxxxxxxxxxxxxxxx>
Fixes: fcfd2fbf22d2587196890103d41e3d554c47da0e
---
Here's the combined patch, if that's preferred. Obviously Correct(tm),
but I'm starting the full test quite right now.
That just takes a few hours. (I have to reboot two machines multiple
times with 32- and 64-bit kernels and and test NFS between them.)
fs/namei.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 968dae02..dcb85255 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1952,20 +1952,20 @@ unsigned int full_name_hash(const char *name, unsigned int len)
EXPORT_SYMBOL(full_name_hash);
/* Return the "hash_len" (hash and length) of a null-terminated string */
-u64 hash_string(const char *name)
+u64 hashlen_string(const char *name)
{
unsigned long hash = init_name_hash();
unsigned long len = 0, c;
c = (unsigned char)*name;
- do {
+ while (c) {
len++;
hash = partial_name_hash(c, hash);
c = (unsigned char)name[len];
- } while (c);
+ }
return hashlen_create(end_name_hash(hash), len);
}
-EXPORT_SYMBOL(hash_string);
+EXPORT_SYMBOL(hashlen_string);
/*
* We know there's a real path component here of at least
--
2.8.1