All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Vivek Goyal <vgoyal@redhat.com>,
	Dharmendra Singh <dharamhans87@gmail.com>,
	Bernd Schubert <bschubert@ddn.com>
Subject: Re: [RFC PATCH] vfs: allow ->atomic_open() on positive
Date: Fri, 20 May 2022 08:44:35 +0200	[thread overview]
Message-ID: <CAJfpegu4Pa+XUnooZn4g9OCK9Kyh9UTSROvah=E57zvg=+53Ww@mail.gmail.com> (raw)
In-Reply-To: <YocT+9pebi3ZBHdn@zeniv-ca.linux.org.uk>

On Fri, 20 May 2022 at 06:07, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Thu, May 19, 2022 at 04:43:58PM +0200, Miklos Szeredi wrote:
> > Hi Al,
> >
> > Do you see anything bad with allowing ->atomic_open() to take a positive dentry
> > and possibly invalidate it after it does the atomic LOOKUP/CREATE+OPEN?
> >
> > It looks wrong not to allow optimizing away the roundtrip associated with
> > revalidation when we do allow optimizing away the roundtrip for the initial
> > lookup in the same situation.
>
> Details, please - what will your ->atomic_open() do in that case?

It will do an open-by-name or create-and-open depending on the flags.
It will return whether the file was created or not.

If created, then the old positive is obviously stale, so it will be
invalidated and a new one allocated.

If not created, then check whether it's the same inode (same as in
->d_revalidate()) and if not, invalidate & allocate new dentry.

Thanks,
Miklos

      reply	other threads:[~2022-05-20  6:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 14:43 [RFC PATCH] vfs: allow ->atomic_open() on positive Miklos Szeredi
2022-05-19 20:09 ` Vivek Goyal
2022-05-19 20:43   ` Bernd Schubert
2022-05-19 20:50     ` Vivek Goyal
2022-05-20  6:48   ` Miklos Szeredi
2022-05-20  4:07 ` Al Viro
2022-05-20  6:44   ` Miklos Szeredi [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='CAJfpegu4Pa+XUnooZn4g9OCK9Kyh9UTSROvah=E57zvg=+53Ww@mail.gmail.com' \
    --to=miklos@szeredi.hu \
    --cc=bschubert@ddn.com \
    --cc=dharamhans87@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=vgoyal@redhat.com \
    --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.