Skip to content

Commit

Permalink
cuse: kill connection on initialization error
Browse files Browse the repository at this point in the history
Luca Risolia reported that a CUSE daemon will continue to run even if
initialization of the emulated device failes for some reason (e.g. the device
number is already registered by another driver).

This patch disconnects the fuse device on error, which will make the userspace
CUSE daemon exit, albeit without indication about what the problem was.

Reported-by: Luca Risolia <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
Miklos Szeredi committed Aug 30, 2012
1 parent bbd9979 commit 8d39d80
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/fuse/cuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static void cuse_process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
err_region:
unregister_chrdev_region(devt, 1);
err:
fc->conn_error = 1;
fuse_conn_kill(fc);
goto out;
}

Expand Down Expand Up @@ -532,8 +532,6 @@ static int cuse_channel_release(struct inode *inode, struct file *file)
cdev_del(cc->cdev);
}

/* kill connection and shutdown channel */
fuse_conn_kill(&cc->fc);
rc = fuse_dev_release(inode, file); /* puts the base reference */

return rc;
Expand Down

0 comments on commit 8d39d80

Please sign in to comment.