Skip to content

Commit 8d39d80

Browse files
author
Miklos Szeredi
committed
cuse: kill connection on initialization error
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 <luca.risolia@studio.unibo.it> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
1 parent bbd9979 commit 8d39d80

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎fs/fuse/cuse.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static void cuse_process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
396396
err_region:
397397
unregister_chrdev_region(devt, 1);
398398
err:
399-
fc->conn_error = 1;
399+
fuse_conn_kill(fc);
400400
goto out;
401401
}
402402

@@ -532,8 +532,6 @@ static int cuse_channel_release(struct inode *inode, struct file *file)
532532
cdev_del(cc->cdev);
533533
}
534534

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

539537
return rc;

0 commit comments

Comments
 (0)