From: Al Viro <viro@zeniv.linux.org.uk>
To: Jori Koolstra <jkoolstra@xs4all.nl>
Cc: Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Namjae Jeon <linkinjeon@kernel.org>,
Steve French <smfrench@gmail.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Tom Talpey <tom@talpey.com>, NeilBrown <neil@brown.name>,
Amir Goldstein <amir73il@gmail.com>,
Jeff Layton <jlayton@kernel.org>,
Mateusz Guzik <mjguzik@gmail.com>,
"open list:FILESYSTEMS (VFS and infrastructure)"
<linux-fsdevel@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
"open list:KERNEL SMB3 SERVER (KSMBD)"
<linux-cifs@vger.kernel.org>
Subject: Re: [PATCH v2] vfs: replace ints with enum component_type for LAST_XXX
Date: Wed, 22 Apr 2026 04:39:52 +0100 [thread overview]
Message-ID: <20260422033952.GG3518998@ZenIV> (raw)
In-Reply-To: <20260419161620.564854-1-jkoolstra@xs4all.nl>
On Sun, Apr 19, 2026 at 06:16:16PM +0200, Jori Koolstra wrote:
> Several functions in namei.c take an "int *type" parameter, such as
> filename_parentat(). To know what values this can take you have to find
> the anonymous struct that defines the LAST_XXX values.
To find _what_, again?
> I would argue
> that the readability of the code is improved by making this an explicit
> type.
Do argue, then. How does that improve readability?
What I see is a lot of churn. Incidentally, I'm not at all sure that we
should expose those outside of fs/namei.c - if you look at the sole place
where any of those are used anywhere else you'll see this:
err = vfs_path_parent_lookup(filename, flags,
path, &last, &type,
root_share_path);
if (err)
return err;
if (unlikely(type != LAST_NORM)) {
path_put(path);
return -ENOENT;
}
with the only other caller of vfs_path_parent_lookup() being
err = vfs_path_parent_lookup(to, lookup_flags | LOOKUP_BENEATH,
&new_path, &new_last, &new_type,
&share_conf->vfs_path);
if (err)
goto out1;
and having no uses of new_type whatsoever. Smells like missing
check _and_ wrong calling conventions...
Do we ever want to allow anything other thant LAST_NORM in any of
the users?
next prev parent reply other threads:[~2026-04-22 3:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-19 16:16 [PATCH v2] vfs: replace ints with enum component_type for LAST_XXX Jori Koolstra
2026-04-20 10:29 ` Amir Goldstein
2026-04-22 10:59 ` Jori Koolstra
2026-04-22 3:39 ` Al Viro [this message]
2026-04-22 10:52 ` Jori Koolstra
-- strict thread matches above, loose matches on Subject: below --
2026-04-01 17:43 Jori Koolstra
2026-04-01 20:43 ` Jan Kara
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=20260422033952.GG3518998@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=jkoolstra@xs4all.nl \
--cc=jlayton@kernel.org \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.com \
--cc=neil@brown.name \
--cc=senozhatsky@chromium.org \
--cc=smfrench@gmail.com \
--cc=tom@talpey.com \
/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