mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
fuse: don't block in fuse_get_dev() for non-sync_init case
Commita8dd5f1b73("fuse: create fuse_dev on /dev/fuse open instead of mount") changed behavior so that fuse_get_dev() now unconditionally blocks waiting for a connection, even in the case where sync_init was not set. Previously, non-sync_init opens returned -EPERM immediately. Restore the previous behavior of returning -EPERM. Fixes:a8dd5f1b73("fuse: create fuse_dev on /dev/fuse open instead of mount") Reported-by: Mark Brown <broonie@kernel.org> Closes: https://lore.kernel.org/all/3c9f8396-41f4-4c88-b883-34bede72b427@sirena.org.uk/ Cc: <stable@vger.kernel.org> Signed-off-by: Joanne Koong <joannelkoong@gmail.com> Tested-by: Mark Brown <broonie@kernel.org> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
254f49634e
commit
9f6f44aa5a
|
|
@ -1562,9 +1562,15 @@ struct fuse_dev *fuse_get_dev(struct file *file)
|
|||
struct fuse_dev *fud = fuse_file_to_fud(file);
|
||||
int err;
|
||||
|
||||
err = wait_event_interruptible(fuse_dev_waitq, fuse_dev_fc_get(fud) != NULL);
|
||||
if (err)
|
||||
return ERR_PTR(err);
|
||||
if (unlikely(!fuse_dev_fc_get(fud))) {
|
||||
/* only block waiting for mount if sync init was requested */
|
||||
if (!fud->sync_init)
|
||||
return ERR_PTR(-EPERM);
|
||||
|
||||
err = wait_event_interruptible(fuse_dev_waitq, fuse_dev_fc_get(fud) != NULL);
|
||||
if (err)
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
return fud;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user