From: "George Spelvin" <linux@sciencehorizons.net>
To: geert@linux-m68k.org, linux@sciencehorizons.net
Cc: linux-kernel@vger.kernel.org, linux@roeck-us.net,
torvalds@linux-foundation.org
Subject: [PATCH] fs/namei.c. If we way we want zero-length string support, mean it
Date: 29 May 2016 08:12:03 -0400 [thread overview]
Message-ID: <20160529121203.2279.qmail@ns.sciencehorizons.net> (raw)
In-Reply-To: <CAMuHMdW4eQimrU12iHmSQiAQM8fwPQ+ZuekaYgJM8GYDuDKsNQ@mail.gmail.com>
>From 4b237fc0c5addf58ef0e0bbd3740d64007c36375 Mon Sep 17 00:00:00 2001
From: George Spelvin <linux@sciencehorizons.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@sciencehorizons.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
next prev parent reply other threads:[~2016-05-29 12:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-29 5:18 Build errors in mainline due to "fs/namei.c:,Add hashlen_string() function" Guenter Roeck
2016-05-29 5:22 ` George Spelvin
2016-05-29 5:26 ` [PATCH] Rename other copy of hash_string to hashlen_string George Spelvin
2016-05-29 10:48 ` Geert Uytterhoeven
2016-05-29 12:02 ` George Spelvin
2016-05-29 12:12 ` George Spelvin [this message]
2016-05-29 17:13 ` [PATCH] fs/namei.c. If we way we want zero-length string support, mean it Geert Uytterhoeven
2016-05-29 12:41 ` [PATCH] fs/namei.c: Update !CONFIG_DCACHE_WORD_ACCESS case George Spelvin
2016-05-29 5:50 ` Build errors in mainline due to "fs/namei.c:,Add hashlen_string() function" George Spelvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160529121203.2279.qmail@ns.sciencehorizons.net \
--to=linux@sciencehorizons.net \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).