From: "Darrick J. Wong" <djwong@kernel.org>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: miklos@szeredi.hu, amir73il@gmail.com,
fuse-devel@lists.linux.dev, luis@igalia.com
Subject: Re: [PATCH v1 01/17] fuse: introduce FUSE_PASSTHROUGH_INO mode
Date: Tue, 21 Apr 2026 14:11:27 -0700 [thread overview]
Message-ID: <20260421211127.GA7739@frogsfrogsfrogs> (raw)
In-Reply-To: <20260420221637.2631478-2-joannelkoong@gmail.com>
On Mon, Apr 20, 2026 at 03:16:21PM -0700, Joanne Koong wrote:
> From: Amir Goldstein <amir73il@gmail.com>
>
> This is a more strict variant of FUSE_PASSTHROUGH mode, in which the
> backing file inode number must match the fuse inode number.
>
> This mode will allow the kernel to instantiate fuse inodes by
> passthrough lookup and passthrough readdirplus and notify about those
> inodes to the server, using the backing file inode number as a unique
> identifier for fuse inodes across kernel and server.
>
> This mode limits the possibility to map multiple fuse inodes to the same
> backing file, unless they are all hardlinks.
>
> This mode is only supported on 64bit arch, where ino_t is u64.
>
> Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
> fs/fuse/file.c | 3 +--
> fs/fuse/fuse_i.h | 6 ++++--
> fs/fuse/inode.c | 8 +++++++-
> fs/fuse/iomode.c | 13 ++++++++++---
> include/uapi/linux/fuse.h | 6 +++++-
> 5 files changed, 27 insertions(+), 9 deletions(-)
>
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 7294bd347412..f239c8a888cb 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -1431,7 +1431,6 @@ static void fuse_dio_lock(struct kiocb *iocb, struct iov_iter *from,
> bool *exclusive)
> {
> struct inode *inode = file_inode(iocb->ki_filp);
> - struct fuse_inode *fi = get_fuse_inode(inode);
>
> *exclusive = fuse_dio_wr_exclusive_lock(iocb, from);
> if (*exclusive) {
> @@ -1446,7 +1445,7 @@ static void fuse_dio_lock(struct kiocb *iocb, struct iov_iter *from,
> * have raced, so check it again.
> */
> if (fuse_io_past_eof(iocb, from) ||
> - fuse_inode_uncached_io_start(fi, NULL) != 0) {
> + fuse_inode_uncached_io_start(inode, NULL) != 0) {
> inode_unlock_shared(inode);
> inode_lock(inode);
> *exclusive = true;
> diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
> index 23a241f18623..86fdf873d639 100644
> --- a/fs/fuse/fuse_i.h
> +++ b/fs/fuse/fuse_i.h
> @@ -913,6 +913,9 @@ struct fuse_conn {
> /** Passthrough support for read/write IO */
> unsigned int passthrough:1;
>
> + /** One-to-one mapping between fuse ino to backing ino */
> + unsigned int passthrough_ino:1;
> +
> /* Use pages instead of pointer for kernel I/O */
> unsigned int use_pages_for_kvec_io:1;
>
> @@ -1535,8 +1538,7 @@ int fuse_fileattr_set(struct mnt_idmap *idmap,
>
> /* iomode.c */
> int fuse_file_cached_io_open(struct inode *inode, struct fuse_file *ff);
> -int fuse_inode_uncached_io_start(struct fuse_inode *fi,
> - struct fuse_backing *fb);
> +int fuse_inode_uncached_io_start(struct inode *inode, struct fuse_backing *fb);
> void fuse_inode_uncached_io_end(struct fuse_inode *fi);
>
> int fuse_file_io_open(struct file *file, struct inode *inode);
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index 8b64034ab0bb..014b9af42909 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -1445,6 +1445,8 @@ static void process_init_reply(struct fuse_mount *fm, struct fuse_args *args,
> fc->passthrough = 1;
> fc->max_stack_depth = arg->max_stack_depth;
> fm->sb->s_stack_depth = arg->max_stack_depth;
> + if (flags & FUSE_PASSTHROUGH_INO)
> + fc->passthrough_ino = 1;
> }
> if (flags & FUSE_NO_EXPORT_SUPPORT)
> fm->sb->s_export_op = &fuse_export_fid_operations;
> @@ -1518,8 +1520,12 @@ static struct fuse_init_args *fuse_new_init(struct fuse_mount *fm)
> #endif
> if (fm->fc->auto_submounts)
> flags |= FUSE_SUBMOUNTS;
> - if (IS_ENABLED(CONFIG_FUSE_PASSTHROUGH))
> + if (IS_ENABLED(CONFIG_FUSE_PASSTHROUGH)) {
> flags |= FUSE_PASSTHROUGH;
> + /* one-to-one ino mapping requires 64bit ino */
> + if (sizeof(ino_t) == sizeof(u64))
Now that struct inode::i_ino is u64 and not ino_t, does this check need
adjusting? I think it's the case that the inode hash will work fine
with a 64-bit inumber.a The fuse uapi defines ino and nodeid fields to
be uint64_t, so I think it should work even on a 32-bit kernel.
That said, ino_t remains kernel_ulong_t in 7.1, so this still won't be
enabled for 32-bit. OTOH maybe none of us care. ;)
--D
> + flags |= FUSE_PASSTHROUGH_INO;
> + }
>
> /*
> * This is just an information flag for fuse server. No need to check
> diff --git a/fs/fuse/iomode.c b/fs/fuse/iomode.c
> index 3728933188f3..ca3b28597722 100644
> --- a/fs/fuse/iomode.c
> +++ b/fs/fuse/iomode.c
> @@ -82,8 +82,10 @@ static void fuse_file_cached_io_release(struct fuse_file *ff,
> }
>
> /* Start strictly uncached io mode where cache access is not allowed */
> -int fuse_inode_uncached_io_start(struct fuse_inode *fi, struct fuse_backing *fb)
> +int fuse_inode_uncached_io_start(struct inode *inode, struct fuse_backing *fb)
> {
> + struct fuse_inode *fi = get_fuse_inode(inode);
> + struct fuse_conn *fc = get_fuse_conn(inode);
> struct fuse_backing *oldfb;
> int err = 0;
>
> @@ -94,6 +96,12 @@ int fuse_inode_uncached_io_start(struct fuse_inode *fi, struct fuse_backing *fb)
> err = -EBUSY;
> goto unlock;
> }
> + /* With FUSE_PASSTHROUGH_INO, fuse and backing ino must match */
> + if (fb && fc->passthrough_ino &&
> + fb->file->f_inode->i_ino != inode->i_ino) {
> + err = -EIO;
> + goto unlock;
> + }
> if (fi->iocachectr > 0) {
> err = -ETXTBSY;
> goto unlock;
> @@ -117,10 +125,9 @@ static int fuse_file_uncached_io_open(struct inode *inode,
> struct fuse_file *ff,
> struct fuse_backing *fb)
> {
> - struct fuse_inode *fi = get_fuse_inode(inode);
> int err;
>
> - err = fuse_inode_uncached_io_start(fi, fb);
> + err = fuse_inode_uncached_io_start(inode, fb);
> if (err)
> return err;
>
> diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
> index c13e1f9a2f12..4be9ccc5b3ff 100644
> --- a/include/uapi/linux/fuse.h
> +++ b/include/uapi/linux/fuse.h
> @@ -240,6 +240,9 @@
> * - add FUSE_COPY_FILE_RANGE_64
> * - add struct fuse_copy_file_range_out
> * - add FUSE_NOTIFY_PRUNE
> + *
> + * 7.46
> + * - add FUSE_PASSTHROUGH_INO
> */
>
> #ifndef _LINUX_FUSE_H
> @@ -275,7 +278,7 @@
> #define FUSE_KERNEL_VERSION 7
>
> /** Minor version number of this interface */
> -#define FUSE_KERNEL_MINOR_VERSION 45
> +#define FUSE_KERNEL_MINOR_VERSION 46
>
> /** The node ID of the root inode */
> #define FUSE_ROOT_ID 1
> @@ -495,6 +498,7 @@ struct fuse_file_lock {
> #define FUSE_ALLOW_IDMAP (1ULL << 40)
> #define FUSE_OVER_IO_URING (1ULL << 41)
> #define FUSE_REQUEST_TIMEOUT (1ULL << 42)
> +#define FUSE_PASSTHROUGH_INO (1ULL << 43)
>
> /**
> * CUSE INIT request/reply flags
> --
> 2.52.0
>
>
next prev parent reply other threads:[~2026-04-21 21:11 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 22:16 [PATCH v1 00/17] fuse: extend passthrough to inode operations Joanne Koong
2026-04-20 22:16 ` [PATCH v1 01/17] fuse: introduce FUSE_PASSTHROUGH_INO mode Joanne Koong
2026-04-21 21:11 ` Darrick J. Wong [this message]
2026-04-21 23:38 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 02/17] fuse: prepare for passthrough of inode operations Joanne Koong
2026-04-21 21:16 ` Darrick J. Wong
2026-04-22 1:12 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 03/17] fuse: prepare for readdir passthrough on directories Joanne Koong
2026-04-21 21:17 ` Darrick J. Wong
2026-04-21 23:12 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 04/17] fuse: implement passthrough for readdir Joanne Koong
2026-04-20 22:16 ` [PATCH v1 05/17] fuse: prepare for long lived reference on backing file Joanne Koong
2026-04-20 22:16 ` [PATCH v1 06/17] fuse: implement passthrough for getattr/statx Joanne Koong
2026-04-20 22:16 ` [PATCH v1 07/17] fuse: prepare to setup backing inode passthrough on lookup Joanne Koong
2026-04-20 22:16 ` [PATCH v1 08/17] fuse: add passthrough ops gating Joanne Koong
2026-04-21 10:48 ` Amir Goldstein
2026-04-22 2:57 ` Joanne Koong
2026-04-22 7:27 ` Amir Goldstein
2026-04-23 1:47 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 09/17] fuse: prepare to cache statx attributes from entry replies Joanne Koong
2026-04-21 12:26 ` Amir Goldstein
2026-04-20 22:16 ` [PATCH v1 10/17] fuse: add struct fuse_entry2_out and helpers for extended " Joanne Koong
2026-04-21 12:25 ` Amir Goldstein
2026-04-22 0:50 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 11/17] fuse: add passthrough lookup Joanne Koong
2026-04-21 13:23 ` Amir Goldstein
2026-04-22 3:17 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 12/17] fuse: add passthrough support for entry creation Joanne Koong
2026-04-21 14:08 ` Amir Goldstein
2026-04-22 3:01 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 13/17] fuse: add passthrough support for atomic file creation Joanne Koong
2026-04-21 19:51 ` Amir Goldstein
2026-04-22 0:40 ` Joanne Koong
2026-04-22 5:10 ` Amir Goldstein
2026-04-20 22:16 ` [PATCH v1 14/17] fuse: use passthrough getattr in setattr suid/sgid handling Joanne Koong
2026-04-21 14:25 ` Amir Goldstein
2026-04-22 3:48 ` Joanne Koong
2026-04-22 5:22 ` Amir Goldstein
2026-04-23 0:03 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 15/17] fuse: add passthrough setattr Joanne Koong
2026-04-21 14:20 ` Amir Goldstein
2026-04-21 14:32 ` Amir Goldstein
2026-04-22 1:09 ` Joanne Koong
2026-04-20 22:16 ` [PATCH v1 16/17] fuse: add passthrough open Joanne Koong
2026-04-21 20:20 ` Amir Goldstein
2026-04-22 4:19 ` Joanne Koong
2026-04-22 4:23 ` Joanne Koong
2026-04-22 6:51 ` Amir Goldstein
2026-04-20 22:16 ` [PATCH v1 17/17] docs: fuse: document extended passthrough (FUSE_PASSTHROUGH_INO) Joanne Koong
2026-04-21 11:09 ` Amir Goldstein
2026-04-22 1:04 ` Joanne Koong
2026-04-21 9:37 ` [PATCH v1 00/17] fuse: extend passthrough to inode operations Amir Goldstein
2026-04-21 13:55 ` Amir Goldstein
2026-04-21 21:05 ` Joanne Koong
2026-04-22 6:02 ` Amir Goldstein
2026-04-23 1:02 ` Joanne Koong
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=20260421211127.GA7739@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=amir73il@gmail.com \
--cc=fuse-devel@lists.linux.dev \
--cc=joannelkoong@gmail.com \
--cc=luis@igalia.com \
--cc=miklos@szeredi.hu \
/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