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 <mszeredi@redhat.com>
This commit is contained in:
Miklos Szeredi 2026-03-31 16:32:21 +02:00
parent ff572265f2
commit e582371be4

View File

@ -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,