aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2018-03-28 10:19:22 -0700
committerGitHub <[email protected]>2018-03-28 10:19:22 -0700
commitb2ab468dded24a090dba9fc8396b3d394011ce14 (patch)
tree52ce015e474ee028851256f3b423075b7cf73f58 /config
parent668173b5764386b47de0beb7c57ff8ce8f68f983 (diff)
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 <[email protected]> Reviewed-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #7335 Closes #7339
Diffstat (limited to 'config')
-rw-r--r--config/user-libaio.m414
-rw-r--r--config/user.m41
-rw-r--r--config/zfs-build.m44
3 files changed, 17 insertions, 2 deletions
diff --git a/config/user-libaio.m4 b/config/user-libaio.m4
new file mode 100644
index 000000000..d7a7cb508
--- /dev/null
+++ b/config/user-libaio.m4
@@ -0,0 +1,14 @@
+dnl #
+dnl # Check for libaio - only used for libaiot test cases.
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_USER_LIBAIO], [
+ LIBAIO=
+
+ AC_CHECK_HEADER([libaio.h], [
+ user_libaio=yes
+ AC_SUBST([LIBAIO], ["-laio"])
+ AC_DEFINE([HAVE_LIBAIO], 1, [Define if you have libaio])
+ ], [
+ user_libaio=no
+ ])
+])
diff --git a/config/user.m4 b/config/user.m4
index f5e5e9acd..f2f366e3c 100644
--- a/config/user.m4
+++ b/config/user.m4
@@ -13,6 +13,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER], [
ZFS_AC_CONFIG_USER_LIBBLKID
ZFS_AC_CONFIG_USER_LIBUDEV
ZFS_AC_CONFIG_USER_LIBSSL
+ ZFS_AC_CONFIG_USER_LIBAIO
ZFS_AC_CONFIG_USER_RUNSTATEDIR
ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS
ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index 818e99982..d9b052e27 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -140,11 +140,11 @@ AC_DEFUN([ZFS_AC_CONFIG], [
AM_CONDITIONAL([CONFIG_KERNEL],
[test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
[test "x$enable_linux_builtin" != xyes ])
- AM_CONDITIONAL([WANT_DEVNAME2DEVID],
- [test "x$user_libudev" = xyes ])
AM_CONDITIONAL([CONFIG_QAT],
[test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all] &&
[test "x$qatsrc" != x ])
+ AM_CONDITIONAL([WANT_DEVNAME2DEVID], [test "x$user_libudev" = xyes ])
+ AM_CONDITIONAL([WANT_MMAP_LIBAIO], [test "x$user_libaio" = xyes ])
])
dnl #