From e582371be4a75c461fecb61b98ee391025f91946 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 31 Mar 2026 16:32:21 +0200 Subject: [PATCH] fuse: remove fuse_mutex protection from fuse_dev_ioctl_sync_init() In normal use ioctl(FUSE_DEV_IOC_SYNC_INIT) comes before the mount() or fsconfig() syscalls, they are executed strictly serially. If ioctl and mount are performed in parallel, the behavior is nondeterministic. Removing the mutex does not change this. Signed-off-by: Miklos Szeredi --- fs/fuse/dev.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index ec2f53b3d2c8..aab98f75b9dd 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2310,16 +2310,13 @@ static long fuse_dev_ioctl_backing_close(struct file *file, __u32 __user *argp) static long fuse_dev_ioctl_sync_init(struct file *file) { - int err = -EINVAL; struct fuse_dev *fud = fuse_file_to_fud(file); - mutex_lock(&fuse_mutex); - if (!fuse_dev_chan_get(fud)) { - fud->sync_init = true; - err = 0; - } - mutex_unlock(&fuse_mutex); - return err; + if (fuse_dev_chan_get(fud)) + return -EINVAL; + + fud->sync_init = true; + return 0; } static long fuse_dev_ioctl(struct file *file, unsigned int cmd,