From patchwork Sat May 12 04:59:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 10395775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3DF9560236 for ; Sat, 12 May 2018 05:02:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3076B28D63 for ; Sat, 12 May 2018 05:02:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24E8428D80; Sat, 12 May 2018 05:02:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D5E228D63 for ; Sat, 12 May 2018 05:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751620AbeELFBd (ORCPT ); Sat, 12 May 2018 01:01:33 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:37608 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751474AbeELFB3 (ORCPT ); Sat, 12 May 2018 01:01:29 -0400 Received: by mail-pf0-f195.google.com with SMTP id e9-v6so3617971pfi.4; Fri, 11 May 2018 22:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9uvb9rBu0zeJS00tnbm1wwwWE81VSHX2CsEMcJOhVDk=; b=f7A1R2wLYSopnCiByF0KfCxMHP2GkwO9MeoMkO5h8IGUJKTru3Ky92ewd3+SJiyy/q V9ErnfmEjJ7tB4cbPtEKFz3xpPPIjCu1xerHaN5O+u1M9z6965QFpwqljrMZIq4ETjsR jPo2ZtnUuPf+AfG7REfy74tuZpoF/H1vuoc8shNArqvqd/7UeJfZYkFg7svtfutJydf0 kgeUA6B3Pw2TkTkFkoNhbH1yho/1qlN1VZq5uYN3tSQRfA2WsUuk7/bcHIKtaKrhLv7H LMZV3imOrzGsAk3d3Sc0GbrexTK6RpAmWdxUZmj9odDH/Vaq7HHRqJCGjiJx6jsKpI2b 6bKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9uvb9rBu0zeJS00tnbm1wwwWE81VSHX2CsEMcJOhVDk=; b=S1W26iZNZDm6GUHKiErZCJ0iSRiojgr3od+rpL0klW6ZGATdGgVdvwjSM56pw93M6d qraR1hHqg8r7Hq/Wlz4PwoCRe7eVWPIGv5xmXXL7+zGAyvxt+VB1sqLVGpc/AgYMZudM YWAGTxXtLx8OBolscVFzHxy5PvhwKSTwevz+u901o3NVCT1hUI7XDwmYN/JTkXx6wuo8 rb8+WRfV7DQHukTYdMXHkRxgNlAdOdY3II3UghP2YKqfhccWSycbuHrFS0jW8eT4H7LN +1+T4fO46bUJYBMrBhsTOwkAVnYZ/8j0ONL6gQp8M2COc1FFkPcW5pV8Fg5R2qxBOBTc rGpQ== X-Gm-Message-State: ALKqPwc9R1mAIYKDk3tpFOaqlSJRK+Feqya9v4HVNGg1/gW+O5KBpXcp WjRNQEeyhkI9Onr25pOuuwpwJw== X-Google-Smtp-Source: AB8JxZrsqfVAAfRcL3RZHK3DsIDQvaOz03LbsTeKrs7mQljGUxb53h7vbhoHhIrw1uETkzw4Bcxj3A== X-Received: by 2002:a63:774f:: with SMTP id s76-v6mr1497043pgc.403.1526101289170; Fri, 11 May 2018 22:01:29 -0700 (PDT) Received: from deepa-ubuntu.lan (c-67-170-212-194.hsd1.ca.comcast.net. [67.170.212.194]) by smtp.gmail.com with ESMTPSA id 206-v6sm7794717pfy.51.2018.05.11.22.01.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 May 2018 22:01:28 -0700 (PDT) From: Deepa Dinamani To: viro@zeniv.linux.org.uk, tglx@linutronix.de Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org, trond.myklebust@primarydata.com Subject: [PATCH 4/6] fs: nfs: get rid of memcpys for inode times Date: Fri, 11 May 2018 21:59:19 -0700 Message-Id: <20180512045921.18311-5-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512045921.18311-1-deepa.kernel@gmail.com> References: <20180512045921.18311-1-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Subsequent patches in the series convert inode timestamps to use struct timespec64 instead of struct timespec as part of solving the y2038 problem. This will lead to type mismatch for memcpys. Use regular assignments instead. Signed-off-by: Deepa Dinamani Cc: trond.myklebust@primarydata.com --- fs/nfs/inode.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index bd15d0b57626..55b62254dd7c 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1315,13 +1315,13 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME) && (fattr->valid & NFS_ATTR_FATTR_CTIME) && timespec_equal(&inode->i_ctime, &fattr->pre_ctime)) { - memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); + inode->i_ctime = fattr->ctime; } if ((fattr->valid & NFS_ATTR_FATTR_PREMTIME) && (fattr->valid & NFS_ATTR_FATTR_MTIME) && timespec_equal(&inode->i_mtime, &fattr->pre_mtime)) { - memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); + inode->i_mtime = fattr->mtime; if (S_ISDIR(inode->i_mode)) nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); } @@ -1667,12 +1667,12 @@ int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fa } if ((fattr->valid & NFS_ATTR_FATTR_CTIME) != 0 && (fattr->valid & NFS_ATTR_FATTR_PRECTIME) == 0) { - memcpy(&fattr->pre_ctime, &inode->i_ctime, sizeof(fattr->pre_ctime)); + fattr->pre_ctime = inode->i_ctime; fattr->valid |= NFS_ATTR_FATTR_PRECTIME; } if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 && (fattr->valid & NFS_ATTR_FATTR_PREMTIME) == 0) { - memcpy(&fattr->pre_mtime, &inode->i_mtime, sizeof(fattr->pre_mtime)); + fattr->pre_mtime = inode->i_mtime; fattr->valid |= NFS_ATTR_FATTR_PREMTIME; } if ((fattr->valid & NFS_ATTR_FATTR_SIZE) != 0 && @@ -1829,7 +1829,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) } if (fattr->valid & NFS_ATTR_FATTR_MTIME) { - memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); + inode->i_mtime = fattr->mtime; } else if (server->caps & NFS_CAP_MTIME) { nfsi->cache_validity |= save_cache_validity & (NFS_INO_INVALID_MTIME @@ -1838,7 +1838,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) } if (fattr->valid & NFS_ATTR_FATTR_CTIME) { - memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); + inode->i_ctime = fattr->ctime; } else if (server->caps & NFS_CAP_CTIME) { nfsi->cache_validity |= save_cache_validity & (NFS_INO_INVALID_CTIME @@ -1875,7 +1875,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) if (fattr->valid & NFS_ATTR_FATTR_ATIME) - memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime)); + inode->i_atime = fattr->atime; else if (server->caps & NFS_CAP_ATIME) { nfsi->cache_validity |= save_cache_validity & (NFS_INO_INVALID_ATIME