From patchwork Fri Feb 12 09:52:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8289841 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E3AFC9F3CD for ; Fri, 12 Feb 2016 09:55:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C5AC20131 for ; Fri, 12 Feb 2016 09:55:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13EE7203E3 for ; Fri, 12 Feb 2016 09:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751938AbcBLJy6 (ORCPT ); Fri, 12 Feb 2016 04:54:58 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:34517 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751707AbcBLJyz (ORCPT ); Fri, 12 Feb 2016 04:54:55 -0500 Received: by mail-pa0-f53.google.com with SMTP id fy10so5082024pac.1; Fri, 12 Feb 2016 01:54:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QP/Zdx8hFas+K57UKDbKPeEn/vUHqSBcQ7QzRx7/8oc=; b=DPdor1eVKIg6K4YmyIucbgYc32iNvTGExMtK6nAGHwgmoeClfrRIYAxH0oa6s1SJsQ ZuFQ/8W1CzQeUGUaFxB5rKytT/AKmwx1R5YdlJeciN0hDUrf95O1Xl7sN1siVa0GlGlO yTZEL1FT9rH/KN77UlNsLRdSdD+aoRyiZab8PKLo3IITaCG9uB8oG9cEjj/UDuvXqLkQ bvI8mWdzgDkZuIHeMdYKzVF6IUIp4tQ07bFEEib0MQgNtDfvT0RdzV5QlDJ5A3uQehvG YqoY8r/WZqEtD0LDFBQbiLXSB+Tfdb9a3sQdjQPVVt+en0MYd3sjhmk/bTfED72Rr38U cr7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QP/Zdx8hFas+K57UKDbKPeEn/vUHqSBcQ7QzRx7/8oc=; b=H8FwyF+aDuuEnEQ7TEwgr36WHT5SyVlKRt2lLAfJ7c+Lqw2ZMr/u+p2uU4FPudCWEd rg1/ZpQVZTtywXXah8+pmERmR17FBKrNOrcZKZ4ZPKkVu84N12YeYHTyALw6+0k1EwPU mOxwJPBtI/4EOPYA4iesZBn564SEk84O9fbXWwhagdfuZ1FcqRWl1i6zJGZSG/mtTv39 deRbJzR+lFW7BnQpq+oGdTrm8i0h3ALYvxJEhr4w5n+GZ2Z9duR19D7TNCVPDvfq4wCV baJ+LHbuoygmSAbMapkSuLCd5zGuGvmT8n2wKgPFTOUj5LFHr9GZyjUih9JwIlWqdd/3 0eXQ== X-Gm-Message-State: AG10YOR8lrEDBzLFbqeOKnLxzu9J4Jotw5bWKLEvGUmfhHg2O+LV0NGn/RgLOEjrdip/7w== X-Received: by 10.66.193.161 with SMTP id hp1mr763305pac.9.1455270894659; Fri, 12 Feb 2016 01:54:54 -0800 (PST) Received: from localhost.localdomain ([106.51.31.162]) by smtp.gmail.com with ESMTPSA id xz6sm18090024pab.42.2016.02.12.01.54.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 01:54:54 -0800 (PST) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org Cc: Arnd Bergmann , Dave Chinner , "Theodore Ts'o" , linux-kernel@vger.kernel.org Subject: [RFC v2c 2/8] fs: cifs: Change auxdata to struct timespec64 data type Date: Fri, 12 Feb 2016 01:52:47 -0800 Message-Id: <1455270773-3249-3-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455270773-3249-1-git-send-email-deepa.kernel@gmail.com> References: <20160212092153.GA2368@deepa-ubuntu> <1455270773-3249-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Aux data timestamps are only used to read in inode timestamps for fscache. The VFS inode timestamps are not y2038 safe as they use struct timespec. These will be changed to use struct timespec64 instead and that is y2038 safe. But, since the above data type conversion will break the end file systems, use accessor functions to access inode times before the vfs change. Also convert the timestamp data types in the individual filesystems to use y2038 safe struct timespec64. The data type change from struct timespec to struct timespec64 is safe because 1.Size of auxdata on 64 bit systems already accounts for struct timespec64. 2.Only auxdata length changes(increases) by a maximum of 128 bits (data type increase and alignment adjustments). 3.Everything else is the same size as before and possibly less big than on 64 bit systems. 4.64 bit data is aligned on a 64 bit boundary even on 32 bit systems, making the alignment requirements also same as on 64 bit systems, except for i386 where alignment requirements pack the struct tighter. Signed-off-by: Deepa Dinamani --- fs/cifs/cache.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c index 6c665bf..713055b 100644 --- a/fs/cifs/cache.c +++ b/fs/cifs/cache.c @@ -221,8 +221,8 @@ const struct fscache_cookie_def cifs_fscache_super_index_def = { * Auxiliary data attached to CIFS inode within the cache */ struct cifs_fscache_inode_auxdata { - struct timespec last_write_time; - struct timespec last_change_time; + struct timespec64 last_write_time; + struct timespec64 last_change_time; u64 eof; }; @@ -259,8 +259,10 @@ cifs_fscache_inode_get_aux(const void *cookie_netfs_data, void *buffer, memset(&auxdata, 0, sizeof(auxdata)); auxdata.eof = cifsi->server_eof; - auxdata.last_write_time = cifsi->vfs_inode.i_mtime; - auxdata.last_change_time = cifsi->vfs_inode.i_ctime; + auxdata.last_write_time = + vfs_time_to_timespec64(cifsi->vfs_inode.i_mtime); + auxdata.last_change_time = + vfs_time_to_timespec64(cifsi->vfs_inode.i_ctime); if (maxbuf > sizeof(auxdata)) maxbuf = sizeof(auxdata); @@ -283,8 +285,10 @@ fscache_checkaux cifs_fscache_inode_check_aux(void *cookie_netfs_data, memset(&auxdata, 0, sizeof(auxdata)); auxdata.eof = cifsi->server_eof; - auxdata.last_write_time = cifsi->vfs_inode.i_mtime; - auxdata.last_change_time = cifsi->vfs_inode.i_ctime; + auxdata.last_write_time = + vfs_time_to_timespec64(cifsi->vfs_inode.i_mtime); + auxdata.last_change_time = + vfs_time_to_timespec64(cifsi->vfs_inode.i_ctime); if (memcmp(data, &auxdata, datalen) != 0) return FSCACHE_CHECKAUX_OBSOLETE;