linux/fs/fuse
Vivek Goyal bb737bbe48 virtiofs: schedule blocking async replies in separate worker
In virtiofs (unlike in regular fuse) processing of async replies is
serialized.  This can result in a deadlock in rare corner cases when
there's a circular dependency between the completion of two or more async
replies.

Such a deadlock can be reproduced with xfstests:generic/503 if TEST_DIR ==
SCRATCH_MNT (which is a misconfiguration):

 - Process A is waiting for page lock in worker thread context and blocked
   (virtio_fs_requests_done_work()).
 - Process B is holding page lock and waiting for pending writes to
   finish (fuse_wait_on_page_writeback()).
 - Write requests are waiting in virtqueue and can't complete because
   worker thread is blocked on page lock (process A).

Fix this by creating a unique work_struct for each async reply that can
block (O_DIRECT read).

Fixes: a62a8ef9d9 ("virtio-fs: add virtiofs filesystem")
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
2020-04-20 17:01:34 +02:00
..
acl.c fuse: Support fuse filesystems outside of init_user_ns 2018-03-20 17:11:44 +01:00
control.c convenience helper: get_tree_single() 2019-07-04 22:01:58 -04:00
cuse.c fuse: use true,false for bool variable 2020-02-06 16:39:28 +01:00
dev.c fuse: fix stack use after return 2020-02-13 09:16:07 +01:00
dir.c fuse: Support RENAME_WHITEOUT flag 2020-02-06 16:39:28 +01:00
file.c virtiofs: schedule blocking async replies in separate worker 2020-04-20 17:01:34 +02:00
fuse_i.h virtiofs: schedule blocking async replies in separate worker 2020-04-20 17:01:34 +02:00
inode.c Merge branch 'merge.nfs-fs_parse.1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-02-08 13:26:41 -08:00
Kconfig fuse: fix Kconfig indentation 2019-11-27 09:35:20 +01:00
Makefile virtio-fs: Change module name to virtiofs.ko 2019-10-14 10:20:33 +02:00
readdir.c fuse: use true,false for bool variable 2020-02-06 16:39:28 +01:00
virtio_fs.c virtiofs: schedule blocking async replies in separate worker 2020-04-20 17:01:34 +02:00
xattr.c fuse: rearrange and resize fuse_args fields 2019-09-10 16:29:48 +02:00