From: Brian Foster <bfoster@redhat.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Ian Kent <raven@themaw.net>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] namei: clear nd->root.mnt before O_CREAT unlazy
Date: Fri, 7 Jan 2022 13:42:41 -0500 [thread overview]
Message-ID: <YdiJoZhJyVRE4xqT@bfoster> (raw)
In-Reply-To: <Ydh9uKldc0cbusbt@zeniv-ca.linux.org.uk>
On Fri, Jan 07, 2022 at 05:51:52PM +0000, Al Viro wrote:
> On Fri, Jan 07, 2022 at 12:32:17PM -0500, Brian Foster wrote:
>
> > > Other problems here (aside of whitespace damage - was that a
> > > cut'n'paste of some kind? Looks like 8859-1 NBSP for each
> > > leading space...) are
> >
> > Hmm.. I don't see any whitespace damage, even if I pull the patch back
> > from the mailing list into my tree..?
>
> That had occured in Ian's reply, almost certainly. Looks like whatever
> he's using for MUA (Evolution?) is misconfigured into doing whitespace
> damage - his next mail (in utf8, rather than 8859-1) had a scattering of
> U+00A0 in it... Frankly, I'd never seen a decent GUI MUA, so I've no
> real experience with that thing and no suggestions on how to fix that.
>
> > > * misleading name of the new helper - it sounds like
> > > "non-RCU side of complete_walk()" and that's not what it does
> >
> > The intent was the opposite, of course. :P I'm not sure how you infer
> > the above from _rcu(), but I'll name the helper whatever. Suggestions?
>
> s/non-// in the above (I really had been half-asleep). What I'm
> saying is that this name invites an assumption that in RCU case
> complete_walk() is equivalent to it. Which is wrong - that's
> what complete_walk() does as the first step if it needs to get
> out of RCU mode.
>
Ah, Ok. I see your point. I suppose we could call it something like
__complete_walk() or __complete_walk_rcu() just to assert that it's a
subcomponent of complete_walk(). Alternatively, we could leave the
complete_walk() bits alone and create a slightly duplicate helper for
the create path (minus LOOKUP_CACHED), or just open code those bits in
the create path without a helper, or perhaps create a lower level helper
along the lines of:
static inline bool nd_reset_root_and_unlazy(struct nameidata *nd)
{
/*
* We don't want to zero nd->root for scoped-lookups or
* externally-managed nd->root.
*/
if (!(nd->state & ND_ROOT_PRESET))
if (!(nd->flags & LOOKUP_IS_SCOPED))
nd->root.mnt = NULL;
return try_to_unlazy(nd);
}
... and then just leave the LOOKUP_RCU check and LOOKUP_CACHED handling
open coded in the callers as they are now. Hm?
Brian
next prev parent reply other threads:[~2022-01-07 19:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 18:02 [PATCH] namei: clear nd->root.mnt before O_CREAT unlazy Brian Foster
2022-01-06 23:46 ` Ian Kent
2022-01-07 5:52 ` Al Viro
2022-01-07 7:04 ` Ian Kent
2022-01-07 7:22 ` Al Viro
2022-01-07 7:10 ` Al Viro
2022-01-07 17:32 ` Brian Foster
2022-01-07 17:51 ` Al Viro
2022-01-07 18:42 ` Brian Foster [this message]
2022-01-08 3:26 ` Ian Kent
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=YdiJoZhJyVRE4xqT@bfoster \
--to=bfoster@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=raven@themaw.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.