From: Alexander Mikhalitsyn <alex@amutable.com>
To: Christian Brauner <brauner@kernel.org>,
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 0/4] fat: support O_TMPFILE
Date: Fri, 27 Nov 2026 09:43:03 +0100 [thread overview]
Message-ID: <ecba7d29cc3bfb0e18ad72d2a9690da41f66c832.camel@amutable.com> (raw)
In-Reply-To: <20261126-work-fat-tmpfile-v1-0-3bca7b2dbc20@kernel.org>
On Thu, 2026-11-26 at 23:15 +0100, Christian Brauner wrote:
> This adds O_TMPFILE support to vfat and msdos.
>
> Currently, every O_TMPFILE open on FAT fails with EOPNOTSUPP and
> userspace falls back to creating a named temporary file and renaming
> it
> into place. systemd does that in bootctl when it writes to the ESP.
>
> FAT can do O_TMPFILE just fine. It already handles files without a
> directory entry: when an open file is unlinked i_pos is reset to 0,
> writing the inode does nothing and the clusters are freed when the
> inode is evicted. An O_TMPFILE simply starts out in that state.
>
> The only tricky part is linkat(). FAT has no hard links so I added a
> ->link() that only gives an O_TMPFILE its first name. Everything else
> still fails with EPERM. Adding just ->tmpfile() would've been a
> regression. systemd only falls back to the named temporary file if
> the
> O_TMPFILE open fails. If the open succeeds it calls linkat() and
> gives
> up if that fails.
Hi Christian,
>
> Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
For the entire series:
Reviewed-by: Alexander Mikhalitsyn <alex@amutable.com>
Kind regards,
Alex
> ---
> Christian Brauner (4):
> fat: add fat_tmpfile()
> fat: support O_TMPFILE on vfat
> fat: support O_TMPFILE on msdos
> selftests/filesystems: add FAT O_TMPFILE tests
>
> fs/fat/fat.h | 2 +
> fs/fat/inode.c | 31 ++
> fs/fat/namei_msdos.c | 70 +++++
> fs/fat/namei_vfat.c | 46 +++
> tools/testing/selftests/filesystems/fat/.gitignore | 1 +
> tools/testing/selftests/filesystems/fat/Makefile | 2 +-
> tools/testing/selftests/filesystems/fat/config | 1 +
> .../selftests/filesystems/fat/run_fat_tests.sh | 41 +++
> tools/testing/selftests/filesystems/fat/tmpfile.c | 324
> +++++++++++++++++++++
> 9 files changed, 517 insertions(+), 1 deletion(-)
> ---
> base-commit: 2dc60bd9975fc8666a13d58410499e06e6799ba9
> change-id: 20261126-work-fat-tmpfile-0d0f49e95d8f
prev parent reply other threads:[~2026-11-27 8:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 22:15 [PATCH 0/4] fat: support O_TMPFILE Christian Brauner
2026-11-26 22:15 ` [PATCH 1/4] fat: add fat_tmpfile() Christian Brauner
2026-11-26 22:15 ` [PATCH 2/4] fat: support O_TMPFILE on vfat Christian Brauner
2026-11-26 22:15 ` [PATCH 3/4] fat: support O_TMPFILE on msdos Christian Brauner
2026-11-26 22:15 ` [PATCH 4/4] selftests/filesystems: add FAT O_TMPFILE tests Christian Brauner
2026-11-27 8:43 ` Alexander Mikhalitsyn [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=ecba7d29cc3bfb0e18ad72d2a9690da41f66c832.camel@amutable.com \
--to=alex@amutable.com \
--cc=brauner@kernel.org \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.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