From: Jan Kara <jack@suse.cz>
To: Jori Koolstra <jkoolstra@xs4all.nl>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
"open list:FILESYSTEMS (VFS and infrastructure)"
<linux-fsdevel@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] vfs: fix docstring of hash_name()
Date: Thu, 19 Mar 2026 13:02:59 +0100 [thread overview]
Message-ID: <b6tzgb7nlxmefkc7mqeyhlpo4o3c6532wdxxpdej5mtoftfch5@6hgola232nx6> (raw)
In-Reply-To: <20260318203953.5770-1-jkoolstra@xs4all.nl>
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
prev parent reply other threads:[~2026-03-19 12:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=b6tzgb7nlxmefkc7mqeyhlpo4o3c6532wdxxpdej5mtoftfch5@6hgola232nx6 \
--to=jack@suse.cz \
--cc=brauner@kernel.org \
--cc=jkoolstra@xs4all.nl \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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