diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-11-09 15:52:16 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-21 09:19:24 +0100 |
commit | 18cd6106cf9b427ae072964c7c36b05df5704cd3 (patch) | |
tree | cf81f76275d683512455ec0ce23ddfc4da5341fc /net | |
parent | 280da476036d8bbbd4fb7f8c2b94c75316cd43d4 (diff) | |
download | linux-stable-18cd6106cf9b427ae072964c7c36b05df5704cd3.tar.gz linux-stable-18cd6106cf9b427ae072964c7c36b05df5704cd3.tar.bz2 linux-stable-18cd6106cf9b427ae072964c7c36b05df5704cd3.zip |
fuse: fix possibly missed wake-up after abort
commit 2d84a2d19b6150c6dbac1e6ebad9c82e4c123772 upstream.
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: b8f95e5d13f5 ("fuse: umount should wait for all requests")
Cc: <stable@vger.kernel.org> #v4.19
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions