fuse: return -ECONNABORTED on /dev/fuse read after abort
authorSzymon Lukasz <noh4hss@gmail.com>
Thu, 9 Nov 2017 20:23:35 +0000 (21:23 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Tue, 20 Mar 2018 16:11:44 +0000 (17:11 +0100)
commit3b7008b226f3de811d4ac34238e9cf670f7c9fe7
tree5f12afe06b3761c54191e37b03377d8da25b8331
parentdf0e91d488276086bc07da2e389986cae0048c37
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>
fs/fuse/control.c
fs/fuse/cuse.c
fs/fuse/dev.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
include/uapi/linux/fuse.h