]> git.proxmox.com Git - mirror_zfs.git/commit
Fix mmap / libaio deadlock
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 28 Mar 2018 17:19:22 +0000 (10:19 -0700)
committerTony Hutter <hutter2@llnl.gov>
Tue, 8 May 2018 00:19:57 +0000 (17:19 -0700)
commit63f339623382383d0bb1b387e950723a503780a3
treeadba3fb6677fd4e8634ca1f2f7a9dfd0e596cfa9
parent2deb4526ee9994736451220ebe3870d258f699b4
Fix mmap / libaio deadlock

Calling uiomove() in mappedread() under the page lock can result
in a deadlock if the user space page needs to be faulted in.

Resolve the issue by dropping the page lock before the uiomove().
The inode range lock protects against concurrent updates via
zfs_read() and zfs_write().

Reviewed-by: Albert Lee <trisk@forkgnu.org>
Reviewed-by: Chunwei Chen <david.chen@nutanix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7335
Closes #7339
14 files changed:
config/user-libaio.m4 [new file with mode: 0644]
config/user.m4
config/zfs-build.m4
configure.ac
module/zfs/zfs_vnops.c
rpm/generic/zfs.spec.in
tests/runfiles/linux.run
tests/zfs-tests/cmd/Makefile.am
tests/zfs-tests/cmd/mmap_libaio/.gitignore [new file with mode: 0644]
tests/zfs-tests/cmd/mmap_libaio/Makefile.am [new file with mode: 0644]
tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c [new file with mode: 0644]
tests/zfs-tests/include/commands.cfg
tests/zfs-tests/tests/functional/mmap/Makefile.am
tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh [new file with mode: 0755]