* [PATCH v2] vfs: fix docstring of hash_name()
@ 2026-03-18 20:39 Jori Koolstra
2026-03-19 10:18 ` Christian Brauner
2026-03-19 12:02 ` Jan Kara
0 siblings, 2 replies; 3+ messages in thread
From: Jori Koolstra @ 2026-03-18 20:39 UTC (permalink / raw)
To: Alexander Viro, Christian Brauner, Jan Kara
Cc: Jori Koolstra, open list:FILESYSTEMS (VFS and infrastructure),
open list
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@xs4all.nl>
---
fs/namei.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 58f715f7657e..9e5500dad14f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2437,8 +2437,14 @@ 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, LAST_WORD_IS_DOT,
+ * LAST_WORD_IS_DOTDOT, or some other value depending on whether the
+ * component is '.', '..', or something else. Otherwise, @lastword is 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] vfs: fix docstring of hash_name()
2026-03-18 20:39 [PATCH v2] vfs: fix docstring of hash_name() Jori Koolstra
@ 2026-03-19 10:18 ` Christian Brauner
2026-03-19 12:02 ` Jan Kara
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2026-03-19 10:18 UTC (permalink / raw)
To: Jori Koolstra
Cc: Christian Brauner, linux-fsdevel, linux-kernel, Alexander Viro,
Jan Kara
On Wed, 18 Mar 2026 21:39:52 +0100, Jori Koolstra wrote:
> 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.
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] vfs: fix docstring of hash_name()
https://git.kernel.org/vfs/vfs/c/8fb6857f2f5e
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] vfs: fix docstring of hash_name()
2026-03-18 20:39 [PATCH v2] vfs: fix docstring of hash_name() Jori Koolstra
2026-03-19 10:18 ` Christian Brauner
@ 2026-03-19 12:02 ` Jan Kara
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2026-03-19 12:02 UTC (permalink / raw)
To: Jori Koolstra
Cc: Alexander Viro, Christian Brauner, Jan Kara,
open list:FILESYSTEMS (VFS and infrastructure), open list
On Wed 18-03-26 21:39:52, Jori Koolstra wrote:
> 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@xs4all.nl>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/namei.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index 58f715f7657e..9e5500dad14f 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -2437,8 +2437,14 @@ 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, LAST_WORD_IS_DOT,
> + * LAST_WORD_IS_DOTDOT, or some other value depending on whether the
> + * component is '.', '..', or something else. Otherwise, @lastword is 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
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-19 12:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 20:39 [PATCH v2] vfs: fix docstring of hash_name() Jori Koolstra
2026-03-19 10:18 ` Christian Brauner
2026-03-19 12:02 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox