[lkml]   [2016]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] fs/namei.c: Update !CONFIG_DCACHE_WORD_ACCESS case
From be5e653c0d5ec890c32a48851dcd0a347df8e5fa Mon Sep 17 00:00:00 2001
From: George Spelvin <>
Date: Sun, 29 May 2016 01:23:14 -0400
Subject: [PATCH] fs/namei.c: Update !CONFIG_DCACHE_WORD_ACCESS case

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 <>
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)

/* 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) {
hash = partial_name_hash(c, hash);
c = (unsigned char)name[len];
- } while (c);
+ }
return hashlen_create(end_name_hash(hash), len);

* We know there's a real path component here of at least
 \ /
  Last update: 2016-05-29 15:01    [W:0.047 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site