linux/fs/fuse
Miklos Szeredi 7767aed419 fuse: fix possibly missed wake-up after abort
[ Upstream commit 2d84a2d19b ]

In current fuse_drop_waiting() implementation it's possible that
fuse_wait_aborted() will not be woken up in the unlikely case that
fuse_abort_conn() + fuse_wait_aborted() runs in between checking
fc->connected and calling atomic_dec(&fc->num_waiting).

Do the atomic_dec_and_test() unconditionally, which also provides the
necessary barrier against reordering with the fc->connected check.

The explicit smp_mb() in fuse_wait_aborted() is not actually needed, since
the spin_unlock() in fuse_abort_conn() provides the necessary RELEASE
barrier after resetting fc->connected.  However, this is not a performance
sensitive path, and adding the explicit barrier makes it easier to
document.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Fixes: b8f95e5d13 ("fuse: umount should wait for all requests")
Cc: <stable@vger.kernel.org> #v4.19
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
2019-05-16 19:42:26 +02:00
..
acl.c fuse: Add posix ACL support 2016-10-01 07:32:32 +02:00
control.c fuse: fix control dir setup and teardown 2018-07-03 11:24:49 +02:00
cuse.c fuse: honor iocb sync flags on write 2017-09-12 16:57:53 +02:00
dev.c fuse: fix possibly missed wake-up after abort 2019-05-16 19:42:26 +02:00
dir.c fuse: continue to send FUSE_RELEASEDIR when FUSE_OPEN returns ENOSYS 2018-12-21 14:13:05 +01:00
file.c fuse: decrement NR_WRITEBACK_TEMP on the right page 2019-02-12 19:46:11 +01:00
fuse_i.h fuse: continue to send FUSE_RELEASEDIR when FUSE_OPEN returns ENOSYS 2018-12-21 14:13:05 +01:00
inode.c fuse: Fix oops at process_init_reply() 2018-09-05 09:26:38 +02:00
Kconfig fuse: Add posix ACL support 2016-10-01 07:32:32 +02:00
Makefile fuse: Use generic xattr ops 2016-10-01 07:32:32 +02:00
xattr.c fuse: limit xattr returned size 2016-10-03 11:06:05 +02:00