summaryrefslogtreecommitdiff
path: root/fs/fuse/cuse.c
diff options
context:
space:
mode:
authorSzymon Lukasz <noh4hss@gmail.com>2017-11-09 21:23:35 +0100
committerMiklos Szeredi <mszeredi@redhat.com>2018-03-20 17:11:44 +0100
commit3b7008b226f3de811d4ac34238e9cf670f7c9fe7 (patch)
tree5f12afe06b3761c54191e37b03377d8da25b8331 /fs/fuse/cuse.c
parentdf0e91d488276086bc07da2e389986cae0048c37 (diff)
fuse: return -ECONNABORTED on /dev/fuse read after abort
Currently the userspace has no way of knowing whether the fuse connection ended because of umount or abort via sysfs. It makes it hard for filesystems to free the mountpoint after abort without worrying about removing some new mount. The patch fixes it by returning different errors when userspace reads from /dev/fuse (-ENODEV for umount and -ECONNABORTED for abort). Add a new capability flag FUSE_ABORT_ERROR. If set and the connection is gone because of sysfs abort, reading from the device will return -ECONNABORTED. Signed-off-by: Szymon Lukasz <noh4hss@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/cuse.c')
-rw-r--r--fs/fuse/cuse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index e9e97803442a..31d33b69957f 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -406,7 +406,7 @@ err_unlock:
err_region:
unregister_chrdev_region(devt, 1);
err:
- fuse_abort_conn(fc);
+ fuse_abort_conn(fc, false);
goto out;
}
@@ -581,7 +581,7 @@ static ssize_t cuse_class_abort_store(struct device *dev,
{
struct cuse_conn *cc = dev_get_drvdata(dev);
- fuse_abort_conn(&cc->fc);
+ fuse_abort_conn(&cc->fc, false);
return count;
}
static DEVICE_ATTR(abort, 0200, NULL, cuse_class_abort_store);