mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chunsheng Luo <luochunsheng@ustc.edu>
To: miklos@szeredi.hu
Cc: amir73il@gmail.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Chunsheng Luo <luochunsheng@ustc.edu>
Subject: [PATCH 2/2] fuse: Relax backing file validation to compare backing inodes
Date: Fri, 16 Jan 2026 22:28:45 +0800	[thread overview]
Message-ID: <20260116142845.422-3-luochunsheng@ustc.edu> (raw)
In-Reply-To: <20260116142845.422-1-luochunsheng@ustc.edu>

To simplify crash recovery and reduce performance impact, backing_ids
are not persisted across daemon restarts. However, when the daemon
restarts and another process open the same FUSE file and assigning it
the same backing file (with the same inode) will also cause the
fuse_inode_uncached_io_start() function to fail due to a mismatch in
the fb pointer.

So Relax the validation in fuse_inode_uncached_io_start() to compare
backing inodes instead of fuse_backing pointers.

Signed-off-by: Chunsheng Luo <luochunsheng@ustc.edu>
---
 fs/fuse/iomode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/iomode.c b/fs/fuse/iomode.c
index 3728933188f3..ca7619958b0d 100644
--- a/fs/fuse/iomode.c
+++ b/fs/fuse/iomode.c
@@ -90,7 +90,7 @@ int fuse_inode_uncached_io_start(struct fuse_inode *fi, struct fuse_backing *fb)
 	spin_lock(&fi->lock);
 	/* deny conflicting backing files on same fuse inode */
 	oldfb = fuse_inode_backing(fi);
-	if (fb && oldfb && oldfb != fb) {
+	if (fb && oldfb && file_inode(oldfb->file) != file_inode(fb->file)) {
 		err = -EBUSY;
 		goto unlock;
 	}
-- 
2.43.0


  parent reply	other threads:[~2026-01-16 14:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16 14:28 [PATCH v2 0/2] fuse/passthrough: simplify daemon crash recovery Chunsheng Luo
2026-01-16 14:28 ` [PATCH 1/2] fuse: add ioctl to cleanup all backing files Chunsheng Luo
2026-01-16 15:39   ` Amir Goldstein
2026-01-17 16:14     ` Chunsheng Luo
2026-01-17 17:00       ` Amir Goldstein
2026-01-18 11:47         ` Chunsheng Luo
2026-01-18 17:07           ` Amir Goldstein
2026-01-18 17:08             ` Amir Goldstein
2026-01-19  2:44               ` Chunsheng Luo
2026-01-16 14:28 ` Chunsheng Luo [this message]
2026-01-16 15:07   ` [PATCH 2/2] fuse: Relax backing file validation to compare backing inodes Amir Goldstein

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=20260116142845.422-3-luochunsheng@ustc.edu \
    --to=luochunsheng@ustc.edu \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®