From: Shaun Tancheff Date: Tue, 10 Dec 2019 09:20:26 +0000 (-0600) Subject: LU-12904 utils: zfs properly detect spa_multihost X-Git-Tag: 2.13.51~50 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=87cc32adc11b3db914dd63e3766614a02e2f988f LU-12904 utils: zfs properly detect spa_multihost spa_multihost is used in a user space tool and the compile test for spa_multihost reflect that. Test-Parameters: trivial Cray-bug-id: LUS-8042 Signed-off-by: Shaun Tancheff Change-Id: Ie85fffb80e84a2b65547e3d48dc0cff31c3325b4 Reviewed-on: https://review.whamcloud.com/36582 Reviewed-by: Nathaniel Clark Reviewed-by: Petros Koutoupis Reviewed-by: James Simmons Reviewed-by: Olaf Faaland-LLNL Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/config/lustre-build-zfs.m4 b/config/lustre-build-zfs.m4 index 80dfcff..f632df1 100644 --- a/config/lustre-build-zfs.m4 +++ b/config/lustre-build-zfs.m4 @@ -548,15 +548,24 @@ your distribution. dnl # dnl # ZFS 0.7.0 feature: MULTIHOST dnl # - LB_CHECK_COMPILE([if ZFS has multihost protection], - spa_multihost, [ - #include - ],[ + restore_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $ZFS_LIBZFS_INCLUDE -Werror" + AC_MSG_CHECKING([[if ZFS has multihost protection]]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [[ + #define _LARGEFILE64_SOURCE 1 + #include + #include + ]], [[ spa_multihost(NULL); - ],[ - AC_DEFINE(HAVE_ZFS_MULTIHOST, 1, - [Have multihost protection in ZFS]) - ]) + ]]) + ],[ + AC_DEFINE(HAVE_ZFS_MULTIHOST, 1, + [Have multihost protection in ZFS]) + spa_multihost_fn="yes"],[spa_multihost_fn="no"]), + AC_MSG_RESULT([$spa_multihost_fn]) + CFLAGS=$restore_CFLAGS dnl # dnl # ZFS 0.7.x adds new method zap_lookup_by_dnode dnl #