fuse: umount should wait for all requests
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 26 Jul 2018 14:13:11 +0000 (16:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 07:20:08 +0000 (09:20 +0200)
commit6465d7688c2d568054c174231fb1d01e3d408e08
tree78be3355bb8c6089fbb7014d94f5a56e8907b173
parentc66025c1085c5983a64ac2a8ed733b8cefe1659d
fuse: umount should wait for all requests

commit b8f95e5d13f5f0191dcb4b9113113d241636e7cb upstream.

fuse_abort_conn() does not guarantee that all async requests have actually
finished aborting (i.e. their ->end() function is called).  This could
actually result in still used inodes after umount.

Add a helper to wait until all requests are fully done.  This is done by
looking at the "num_waiting" counter.  When this counter drops to zero, we
can be sure that no more requests are outstanding.

Fixes: 0d8e84b0432b ("fuse: simplify request abort")
Cc: <stable@vger.kernel.org> # v4.2
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/dev.c
fs/fuse/fuse_i.h
fs/fuse/inode.c