[PATCH] vfs: fix docstring of hash_name()

From: Jori Koolstra

Date: Thu Mar 12 2026 - 07:37:08 EST


The docstring of hash_name() is falsely reporting that it returns the
component length, whereas it returns a pointer to the terminating '/'
or NUL character in the pathname being resolved.

Signed-off-by: Jori Koolstra <jkoolstra@xxxxxxxxx>
---
fs/namei.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index 58f715f7657e..d020b077591b 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2437,8 +2437,13 @@ u64 hashlen_string(const void *salt, const char *name)
EXPORT_SYMBOL(hashlen_string);

/*
- * Calculate the length and hash of the path component, and
- * return the length as the result.
+ * hash_name - Calculate the length and hash of the path component
+ * @nd: the path resolution state
+ * @name: the pathname to read the component from
+ * @lastword: if the component fits in a single word, the component bytes,
+ * otherwise 0
+ *
+ * Returns: a pointer to the terminating '/' or NUL character in @name.
*/
static inline const char *hash_name(struct nameidata *nd,
const char *name,
--
2.53.0