From patchwork Mon Nov 11 20:16:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11237661 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E582813BD for ; Mon, 11 Nov 2019 20:22:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CACBA21655 for ; Mon, 11 Nov 2019 20:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727589AbfKKUWA (ORCPT ); Mon, 11 Nov 2019 15:22:00 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:34829 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727483AbfKKUWA (ORCPT ); Mon, 11 Nov 2019 15:22:00 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1Mw9Hm-1heMNx137E-00s7xT; Mon, 11 Nov 2019 21:16:49 +0100 From: Arnd Bergmann To: linux-nfs@vger.kernel.org, "J. Bruce Fields" , Chuck Lever , Trond Myklebust , Anna Schumaker Cc: y2038@lists.linaro.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 09/19] nfsd: print 64-bit timestamps in client_info_show Date: Mon, 11 Nov 2019 21:16:29 +0100 Message-Id: <20191111201639.2240623-10-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191111201639.2240623-1-arnd@arndb.de> References: <20191111201639.2240623-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:seMJ42v1081bEPvwevwNuzbDoR7i4rBfE32rXv/gDtp4js7XnsP 3mzBJKVOUnKQzd/TGe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M8r4FR5DA4uJK6Nh5EwekCwg22J zSUwzSRZPyzeVhMzJdQQ== Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org The nii_time field gets truncated to 'time_t' on 32-bit architectures before printing. Remove the use of 'struct timespec' to product the correct output beyond 2038. Signed-off-by: Arnd Bergmann --- fs/nfsd/nfs4state.c | 5 ++--- fs/nfsd/state.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a20795b5053c..2333924d7c6b 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2292,7 +2292,7 @@ static int client_info_show(struct seq_file *m, void *v) clp->cl_nii_domain.len); seq_printf(m, "\nImplementation name: "); seq_quote_mem(m, clp->cl_nii_name.data, clp->cl_nii_name.len); - seq_printf(m, "\nImplementation time: [%ld, %ld]\n", + seq_printf(m, "\nImplementation time: [%lld, %ld]\n", clp->cl_nii_time.tv_sec, clp->cl_nii_time.tv_nsec); } drop_client(clp); @@ -2946,8 +2946,7 @@ static __be32 copy_impl_id(struct nfs4_client *clp, xdr_netobj_dup(&clp->cl_nii_name, &exid->nii_name, GFP_KERNEL); if (!clp->cl_nii_name.data) return nfserr_jukebox; - clp->cl_nii_time.tv_sec = exid->nii_time.tv_sec; - clp->cl_nii_time.tv_nsec = exid->nii_time.tv_nsec; + clp->cl_nii_time = exid->nii_time; return 0; } diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 46f56afb6cb8..ce32ba445343 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -320,7 +320,7 @@ struct nfs4_client { /* NFSv4.1 client implementation id: */ struct xdr_netobj cl_nii_domain; struct xdr_netobj cl_nii_name; - struct timespec cl_nii_time; + struct timespec64 cl_nii_time; /* for v4.0 and v4.1 callbacks: */ struct nfs4_cb_conn cl_cb_conn;