[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160529121203.2279.qmail@ns.sciencehorizons.net>
Date: 29 May 2016 08:12:03 -0400
From: "George Spelvin" <linux@...encehorizons.net>
To: geert@...ux-m68k.org, linux@...encehorizons.net
Cc: linux-kernel@...r.kernel.org, linux@...ck-us.net,
torvalds@...ux-foundation.org
Subject: [PATCH] fs/namei.c. If we way we want zero-length string support, mean it
>From 4b237fc0c5addf58ef0e0bbd3740d64007c36375 Mon Sep 17 00:00:00 2001
From: George Spelvin <linux@...encehorizons.net>
Date: Sun, 29 May 2016 08:05:56 -0400
Subject: [PATCH] fs/namei.c. If we way we want zero-length string suppor mean it.
hash_name() is not changed for speed, but the more general
purpose hashlen_string need to support zero-length strings.
Signed-off-by: George Spelvin <linux@...encehorizons.net>
Fixes: fcfd2fbf22d2587196890103d41e3d554c47da0e
---
Just kill me. I didn't re-test the side of the code that I "didn't touch",
but at Bruce Field's (correct!) prompting, I changed the test to cover
a corner case it hadn't addressed.
fs/namei.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index aefba699..dcb85255 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1958,11 +1958,11 @@ u64 hashlen_string(const char *name)
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(hashlen_string);
--
2.8.1
Powered by blists - more mailing lists