From patchwork Fri Dec 13 14:10:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11290619 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 F052B18B8 for ; Fri, 13 Dec 2019 20:37:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADE7E2474A for ; Fri, 13 Dec 2019 20:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727617AbfLMOLC (ORCPT ); Fri, 13 Dec 2019 09:11:02 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:45377 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727444AbfLMOLC (ORCPT ); Fri, 13 Dec 2019 09:11:02 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MAwPZ-1iYuxC2l69-00BMTf; Fri, 13 Dec 2019 15:10:55 +0100 From: Arnd Bergmann To: "J. Bruce Fields" , Chuck Lever Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, y2038@lists.linaro.org, Arnd Bergmann Subject: [PATCH v2 02/12] nfsd: print 64-bit timestamps in client_info_show Date: Fri, 13 Dec 2019 15:10:36 +0100 Message-Id: <20191213141046.1770441-3-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191213141046.1770441-1-arnd@arndb.de> References: <20191213141046.1770441-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:9SKRS2jmAK5+hO6gAt+vF42FOBN1KpKLDxwzePH1lowj6foByry CIqvaRNhyDSGJgY3FraE0vEHhTpHpKrfa5lHsX29Shlb19GnvHhd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mcGvnIzxg== 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 bfdb3366239c..27a629cc5a46 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 d61b83b9654c..2b4165cd1d3e 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;