From: Al Viro <viro@zeniv.linux.org.uk>
To: NeilBrown <neilb@suse.de>
Cc: Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Amir Goldstein <amir73il@gmail.com>,
James Clark <james.clark@arm.com>,
ltp@lists.linux.it, linux-nfs@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] VFS: generate FS_CREATE before FS_OPEN when ->atomic_open used.
Date: Wed, 12 Jun 2024 04:14:04 +0100 [thread overview]
Message-ID: <20240612031404.GH1629371@ZenIV> (raw)
In-Reply-To: <171816094008.14261.10304380583720747013@noble.neil.brown.name>
On Wed, Jun 12, 2024 at 12:55:40PM +1000, NeilBrown wrote:
> > IF we don't care about that, we might as well take fsnotify_open()
> > out of vfs_open() and, for do_open()/do_tmpfile()/do_o_path(), into
> > path_openat() itself. I mean, having
> > if (likely(!error)) {
> > if (likely(file->f_mode & FMODE_OPENED)) {
> > fsnotify_open(file);
> > return file;
> > }
> > in there would be a lot easier to follow... It would lose fsnotify_open()
> > in a few more failure exits, but if we don't give a damn about having it
> > paired with fsnotify_close()...
> >
>
> Should we have fsnotify_open() set a new ->f_mode flag, and
> fsnotify_close() abort if it isn't set (and clear it if it is)?
> Then we would be guaranteed a balance - which does seem like a good
> idea.
Umm... In that case, I would rather have FMODE_NONOTIFY set just before
the fput() in path_openat() - no need to grab another flag from ->f_mode
(not a lot of unused ones there) and no need to add any overhead on
the fast path.
next prev parent reply other threads:[~2024-06-12 3:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 2:05 [PATCH] VFS: generate FS_CREATE before FS_OPEN when ->atomic_open used NeilBrown
2024-06-12 2:37 ` Al Viro
2024-06-12 2:55 ` NeilBrown
2024-06-12 3:14 ` Al Viro [this message]
2024-06-12 7:08 ` NeilBrown
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=20240612031404.GH1629371@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=james.clark@arm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=neilb@suse.de \
/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