Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Jimmy Zuber <jamz@amazon.com>
To: NeilBrown <neil@brown.name>
Cc: Miklos Szeredi <miklos@szeredi.hu>, <fuse-devel@lists.linux.dev>,
	<linux-kselftest@vger.kernel.org>, Shuah Khan <shuah@kernel.org>,
	"Bernd Schubert" <bernd@bsbernd.com>,
	Jim Harris <jiharris@nvidia.com>,
	"Horst Birthelmer" <horst@birthelmer.de>,
	Luis Henriques <luis@igalia.com>
Subject: Re: [PATCH 0/3] fuse: atomic open
Date: Thu, 22 Oct 2026 01:46:15 +0000	[thread overview]
Message-ID: <20261022014616.2503204-1-jamz@amazon.com> (raw)
In-Reply-To: <179253922666.1724252.16392934420146585044@noble.neil.brown.name>

On Wed, 21 Oct 2026, NeilBrown wrote:
> This all looks like a reasonably sensible design. As permission checking
> happens in the client, not on the server, it is appropriate that
> FUSE_OPEN_ATOMIC only opens the file if it actually created it.
> So it doesn't make sense to implement O_TRUNC.
>
> However the code seems to suggest that the server might open the file if
> it was found to already exist.  In that case, were does the permission
> check happen...
>
> Maybe I need a more explicit statement of what FUSE_OPEN_ATOMIC is meant
> to do in the various cases.  Or maybe I just don't know enough about
> fuse.

FUSE_OPEN_ATOMIC will open an existing regular file unless O_TRUNC is
specified. If the server opens an existing file, the kernel will perform a
permission check after the reply (do_open() calls may_open()). If that
permission check fails, we will release the file. This matches other file
systems that support atomic_open(), such as ceph, where a file can be opened
before a kernel check is performed. Servers that don't want this should just
return the entry only to have the kernel check permissions and open. I'll try
to make the expected behavior of FUSE_OPEN_ATOMIC implementations more clear
in v2.

> There is work underway to support O_CREAT|O_DIRECTORY so that a
> directory can be created and opened in a single operation.  Would it
> make sense to include this in FUSE_OPEN_ATOMIC ??

Oh thanks for the heads up. This would be a nice fit. If that series is
accepted I can update this one accordingly. That said, even with that series
it might be nice to have an init flag in case implementations want to
selectively support atomic file but not directory open/create (ENOSYS is too
coarse grained).

  reply	other threads:[~2026-10-22  1:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 14:16 [PATCH 0/3] fuse: atomic open jamz
2026-10-20 14:16 ` [PATCH 1/3] fuse: add FUSE_OPEN_ATOMIC jamz
2026-10-20 23:23   ` NeilBrown
2026-10-22  1:45     ` Jimmy Zuber
2026-10-22  5:26       ` NeilBrown
2026-10-20 14:16 ` [PATCH 2/3] fuse: open cached files with FUSE_OPEN_ATOMIC jamz
2026-10-20 14:16 ` [PATCH 3/3] selftests/fuse: add test for FUSE_OPEN_ATOMIC jamz
2026-10-20 23:33 ` [PATCH 0/3] fuse: atomic open NeilBrown
2026-10-22  1:46   ` Jimmy Zuber [this message]
2026-10-22  5:30     ` 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=20261022014616.2503204-1-jamz@amazon.com \
    --to=jamz@amazon.com \
    --cc=bernd@bsbernd.com \
    --cc=fuse-devel@lists.linux.dev \
    --cc=horst@birthelmer.de \
    --cc=jiharris@nvidia.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luis@igalia.com \
    --cc=miklos@szeredi.hu \
    --cc=neil@brown.name \
    --cc=shuah@kernel.org \
    /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