From: James Simmons Date: Mon, 7 Jan 2019 16:46:38 +0000 (-0500) Subject: LU-11838 kernel: harden current_time autoconf test X-Git-Tag: 2.12.51~35 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=74b3726f42b1f72e289e3c3252030a62646afa7b LU-11838 kernel: harden current_time autoconf test In newer kernels CURRENT_TIME was replaced by current_time(). The return value of current_time() was struct timespec but to support time after 2038 the return value was changed to struct timespec64. This change broke the autoconf test. The solution is to use one of the struct iattr field in the autoconf test since it hides the return value type. Test-Parameters: trivial Change-Id: I95abd2cd2b777f99cbf6ab78370ee2171e5fca67 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/33963 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index f4d6a25..227fd38 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2899,7 +2899,9 @@ LB_CHECK_COMPILE([if CURRENT_TIME has been replaced with current_time], current_time, [ #include ],[ - struct timespec ts = current_time(NULL); + struct iattr attr; + + attr.ia_atime = current_time(NULL); ],[ AC_DEFINE(HAVE_CURRENT_TIME, 1, [current_time() has replaced CURRENT_TIME])