diff options
author | Szymon Lukasz <noh4hss@gmail.com> | 2017-11-09 21:23:35 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-03-20 17:11:44 +0100 |
commit | 3b7008b226f3de811d4ac34238e9cf670f7c9fe7 (patch) | |
tree | 5f12afe06b3761c54191e37b03377d8da25b8331 /fs/fuse/cuse.c | |
parent | df0e91d488276086bc07da2e389986cae0048c37 (diff) | |
download | linux-3b7008b226f3de811d4ac34238e9cf670f7c9fe7.tar.gz linux-3b7008b226f3de811d4ac34238e9cf670f7c9fe7.tar.bz2 linux-3b7008b226f3de811d4ac34238e9cf670f7c9fe7.zip |
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.c | 4 |
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); |