Re: [PATCH v2] fs: try an opportunistic lookup for O_CREAT opens too

Jeff Layton
2024-08-14T11:48:19Z

On Wed, 2024-08-14 at 03:40 +0100, Al Viro wrote:
> On Wed, Aug 14, 2024 at 03:18:17AM +0100, Al Viro wrote:
>
> > That's not the only problem; your "is it negative" test is inherently
> > racy in RCU mode. IOW, what is positive at the time you get here can
> > bloody well go negative immediately afterwards. Hit that with
> > O_CREAT and you've got a bogus ENOENT...
>
> Hmm... OTOH, in that case you end up in step_into(), which will do the
> right thing...
>
> How well does that series survive NFS client regression tests?
> That's where I'd expect potentially subtle shite, what with short-circuited
> ->d_revalidate() on the final pathwalk step in open()...

Christian took in my v3 patch which is a bit different from this one.
It seems to be doing fine in testing with NFS and otherwise.

I don't think we short-circuit the d_revalidate though, do we? That
version calls lookup_fast on the last component which should
d_revalidate the last dentry before returning it.
--
Jeff Layton <jlayton@kernel.org>