From 5601d68528969648a8dbb30004196c39f2e6d5a6 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Mon, 10 Jun 2019 22:26:42 -0700 Subject: [PATCH] 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 This patch is back-ported from the following one: Lustre-commit: 74b3726f42b1f72e289e3c3252030a62646afa7b Lustre-change: https://review.whamcloud.com/33963 Change-Id: I95abd2cd2b777f99cbf6ab78370ee2171e5fca67 Signed-off-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: Ben Evans Reviewed-on: https://review.whamcloud.com/35170 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index cad07ff..07ee23c 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2903,7 +2903,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]) -- 1.8.3.1