summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorZhao Chen <winters.zc@antgroup.com>2024-01-09 17:24:43 +0800
committerMiklos Szeredi <mszeredi@redhat.com>2024-03-06 09:56:35 +0100
commit9e7f5296f475ba5ab887ae3e55b922e17e99752b (patch)
treeeb33e03ce83450e7168ab505a0437b1f2f19788a /fs/fuse
parent760eac73f9f69aa28fcb3050b4946c2dcc656d12 (diff)
downloadlinux-9e7f5296f475ba5ab887ae3e55b922e17e99752b.tar.gz
linux-9e7f5296f475ba5ab887ae3e55b922e17e99752b.tar.bz2
linux-9e7f5296f475ba5ab887ae3e55b922e17e99752b.zip
fuse: Use the high bit of request ID for indicating resend requests
Some FUSE daemons want to know if the received request is a resend request. The high bit of the fuse request ID is utilized for indicating this, enabling the receiver to perform appropriate handling. The init flag "FUSE_HAS_RESEND" is added to indicate this feature. Signed-off-by: Zhao Chen <winters.zc@antgroup.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dev.c2
-rw-r--r--fs/fuse/inode.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 3c15a6b7f6f2..3ec8bb5e68ff 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1814,6 +1814,8 @@ static void fuse_resend(struct fuse_conn *fc)
list_for_each_entry_safe(req, next, &to_queue, list) {
__set_bit(FR_PENDING, &req->flags);
+ /* mark the request as resend request */
+ req->in.h.unique |= FUSE_UNIQUE_RESEND;
}
spin_lock(&fiq->lock);
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index ca5fad57bfa4..02869edf72f3 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1370,7 +1370,7 @@ void fuse_send_init(struct fuse_mount *fm)
FUSE_HANDLE_KILLPRIV_V2 | FUSE_SETXATTR_EXT | FUSE_INIT_EXT |
FUSE_SECURITY_CTX | FUSE_CREATE_SUPP_GROUP |
FUSE_HAS_EXPIRE_ONLY | FUSE_DIRECT_IO_ALLOW_MMAP |
- FUSE_NO_EXPORT_SUPPORT;
+ FUSE_NO_EXPORT_SUPPORT | FUSE_HAS_RESEND;
#ifdef CONFIG_FUSE_DAX
if (fm->fc->dax)
flags |= FUSE_MAP_ALIGNMENT;