From: Jori Koolstra <jkoolstra@xs4all.nl>
To: Jan Kara <jack@suse.cz>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
"open list:FILESYSTEMS (VFS and infrastructure)"
<linux-fsdevel@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] vfs: fix docstring of hash_name()
Date: Wed, 18 Mar 2026 21:41:28 +0100 (CET) [thread overview]
Message-ID: <761566493.2262498.1773866488791@kpc.webmail.kpnmail.nl> (raw)
In-Reply-To: <3d42elzgtl5igw3xswvo4nc6bygho6oe6zuijqwy2kjpurbv2k@w42aryoa7v2w>
> Op 17-03-2026 09:43 CET schreef Jan Kara <jack@suse.cz>:
>
>
> On Thu 12-03-26 12:28:22, 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>
> > ---
> > 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
>
> The @lastword description is what the function does but not really the
> point of the parameter. I think more understandable description would be:
> LAST_WORD_IS_DOT, LAST_WORD_IS_DOTDOT, or some other value depending on
> whether the component is '.', '..', or something else.
>
> Otherwise the fix looks good.
Thanks, Jan. I incorporated your suggestion and sent it again. I really appreciate it!
>
> Honza
> --
> Jan Kara <jack@suse.com>
> SUSE Labs, CR
prev parent reply other threads:[~2026-03-18 20:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 11:28 [PATCH] vfs: fix docstring of hash_name() Jori Koolstra
2026-03-17 8:43 ` Jan Kara
2026-03-18 20:41 ` Jori Koolstra [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=761566493.2262498.1773866488791@kpc.webmail.kpnmail.nl \
--to=jkoolstra@xs4all.nl \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--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