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
This commit is contained in:
Brian Behlendorf
2018-03-28 10:19:22 -07:00
committed by Tony Hutter
parent 2deb4526ee
commit 63f3396233
14 changed files with 184 additions and 5 deletions
+1
View File
@@ -158,6 +158,7 @@ export ZFSTEST_FILES='chg_usr_exec
mkfiles
mktree
mmap_exec
mmap_libaio
mmapwrite
randfree_file
readmmap