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