From patchwork Wed Jun 20 14:02:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 139343 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp831364lji; Wed, 20 Jun 2018 07:03:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKVsWgcSfQfFOv64WV7ZTfFm9DNm0Z0p5UMpbWzPX9FDcC+NhAqZgiuxkg1e+vVowHWKI1D X-Received: by 2002:a63:af50:: with SMTP id s16-v6mr19282715pgo.263.1529503403704; Wed, 20 Jun 2018 07:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529503403; cv=none; d=google.com; s=arc-20160816; b=ptfnmp82c8WzIPE5o42r0IMwDV49dCLJ/7oOoRbgIHISU9s8TSc4ZC5mxH1v+ISzKj F23mB6qbuEWVqDuJdLiyGQlXTQ/1F3GXRNOg+TSZ28YO6Etyd9HUdIy8cXqmCy0olUvo IYKQ7ACC/2jzfqbN/eGW3xBpSVvHQGaHazRHopx+3VUedA4k3vcQBQ7BFWniC1NhfBCz NOW+0vCLktfV1hwZMX4HsDhM3NvYgBTOtexa0jqxpgmvf8bpq/x/UHFfSqg3hKaFsp59 IwJjF1iVHZi0C3X0t7yKtGcgycqCZWPoWiKgGKBRIDyFU4fqgVQuJRHd4UgyTNNbyCc3 w4ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=5KkhWO/yXrra1Qtg00kna2mGXMxYUZXanF5/iUk0XMU=; b=uoDnWTtIqzdRjVA2Mym6CE8sUs2JkgiYs/szeGJTqi1Mz2BhJPgT/4oj5bPzT3hPT2 FnK9myHMxFcdwl9PMOarr//YWsPWwH7zEl4eKpKqzBKCHt1fifbZdOuV2nkUSamrLG1c HhsBKUn/IbN1kP3HHixtqTnoWe4VzWpF0mlAeBZqb+rCDMuE6+m0t68wCnopVFQHsMnt AAAESOItEY8mDft2BJtWxlcpF29AmlqjayWkDGfhxQ970HCqFxapV4t75fhk35xXfQIZ 5tBPfD+t/Go30zmaWzKlwgWrtWzQ3HYsyuRl4IELx2iUL8MIGMMWs91hUx6/QvycFfhH /GbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t26-v6si881674pge.100.2018.06.20.07.03.23; Wed, 20 Jun 2018 07:03:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754011AbeFTODV (ORCPT + 30 others); Wed, 20 Jun 2018 10:03:21 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:42865 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752951AbeFTODU (ORCPT ); Wed, 20 Jun 2018 10:03:20 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lx4sD-1gGBoW1ZpR-016f6u; Wed, 20 Jun 2018 16:02:57 +0200 From: Arnd Bergmann To: David Howells Cc: y2038@lists.linaro.org, Arnd Bergmann , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] [v2] afs: stop using time_t for internal times Date: Wed, 20 Jun 2018 16:02:47 +0200 Message-Id: <20180620140256.19648-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:Lxn+1U/8re2lIeaD19RxYEV7PzzWtOPBXz2AQ2Z/PF7fzVqFNVd 9m7UwZ7m83cf/yfzpNGyzrvKwqgE/yOU8w+tppuEXXmeaud/OikltIiX6bWNltLBC4/V7fC 4w8NG9LzoDxmYKhxI1tA18Azbf79Slbe9fajH3WVBp+tEXJIoTAulO3+fNAVQOQADZFTxKx laiSioEzF2oXI22D7HoKg== X-UI-Out-Filterresults: notjunk:1; V01:K0:7IeezqHgk8I=:aOupF9trc1pmuJwNO7wW6K 2RYXLC34HA/Y4FyZcY21FCsuyYbJxAN61Ee+vfoftS337tGRT0kEsdGaDsqLPMHr92LqgB0T1 1bSB8aZDoBp6hivxvMsBlv+P8vO+ex/l3ba7U8HLIiPZpf6NMM76mbK6kGKWTTY1AHO7ZU1y2 31YQUgXa4QpQRT9fRAfp7eSI5pgB82YI7E29PUvCBa35I+Qq1sUqNAB8B3bsiAkcMpmhgmHyP 10e2V0npJxyx86eD0jDxj7PfYbsw9uFxmH15UiGuc0M9przGqRjEdy2ISy5IOocMdB4XYvFnS Fa+BGMruR0POs9V75YyaGcCjOLF/GoEyB6dA5CJPhVjNYisj2lAB8ZZ//kMn+ePrh2n3WR8oA 1vnZNLfiVxwROhtOTxAAPTxVigO32P8Ni44Eek1ABzu+JuYk2XtfqM9faUFLjoTEhKB1Hz+ki PqYPewrEo6HaNuZEX77TLoWd7+T6b/sC8zNfuF/iNHw4aPq50+IA/V2yGkTQVMiYMrkVT3YWh zKGR1z/MM+yH1VjhXfyqvMI8r2cImQV1UiI60Kc67HX+8LtkFjFGnM/1l27VuFsZZOm2Gsxac F3F95iuabLjAqtzzZC520ox0v6D0X1PIr2kc6Vm/7jqKZ3xTBaFoXm07TbfQ1PBCn1gihvNkJ lpvYUUTn1ilMc0QhVG1t7RHUUryzYianENS84rmU3uPviMBtM/5MJ+wcH/0N4W2YXJwc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org afs uses 32-bit timestamps everywhere, but mixes signed and unsigned usage, which is a bit inconsistent. In particular on 32-bit machines, it currently uses unsigned timestamps (ranging from 1970 to 2106) for locally modified files, but signed timestamps (rand 1902 to 2038) when reading from a remote end. On 64-bit machines, we always interpret timestamps as unsigned here. This replaces the deprecated time_t with a new explicitly unsigned afs_time32_t to get a consistent interpretation of inode times according the the wire protocol definition. This avoids the y2038 overflow on 32-bit machines, extending the range to the end of the afs_time32_t in year 2106. On 64-bit machines, using the shorter type saves a few bytes for each afs_file_status and afs_volsync saves a few bytes over time_t or time64_t. Note that mtime_server and struct afs_volsync are not currently used in any meaningful way and could be removed completely. Signed-off-by: Arnd Bergmann --- fs/afs/afs.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/fs/afs/afs.h b/fs/afs/afs.h index b4ff1f7ae4ab..a17f4ce06323 100644 --- a/fs/afs/afs.h +++ b/fs/afs/afs.h @@ -26,6 +26,7 @@ typedef unsigned afs_volid_t; typedef unsigned afs_vnodeid_t; typedef unsigned long long afs_dataversion_t; +typedef unsigned afs_time32_t; typedef enum { AFSVL_RWVOL, /* read/write volume */ @@ -129,8 +130,8 @@ typedef u32 afs_access_t; struct afs_file_status { u64 size; /* file size */ afs_dataversion_t data_version; /* current data version */ - time_t mtime_client; /* last time client changed data */ - time_t mtime_server; /* last time server changed data */ + afs_time32_t mtime_client; /* last time client changed data */ + afs_time32_t mtime_server; /* last time server changed data */ unsigned abort_code; /* Abort if bulk-fetching this failed */ afs_file_type_t type; /* file type */ @@ -158,7 +159,7 @@ struct afs_file_status { * AFS volume synchronisation information */ struct afs_volsync { - time_t creation; /* volume creation time */ + afs_time32_t creation; /* volume creation time */ }; /* From patchwork Wed Jun 20 14:02:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 139344 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp831575lji; Wed, 20 Jun 2018 07:03:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKoVsy/fshe5m5Fibrn0GwiKdVXA/wd2RlwiBAKoOsgnpsNC+g6XgHEzZYiYT0jwG5lBWp5 X-Received: by 2002:a63:5ec4:: with SMTP id s187-v6mr18664602pgb.72.1529503411811; Wed, 20 Jun 2018 07:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529503411; cv=none; d=google.com; s=arc-20160816; b=EnQezQyhjJZhNIh2tYJL4cPEDEaFQE7IBecfJYURMOlIsHV+dOrjdshL1LGa4O4C94 lGGhZBeus64iq1918QwIBWzHLI8FeprOgxItYNFhgiDnyGYz53R3VwmRTFiLzEZnyqCz khk/5FfhLUbYBz+3zamAz2RqZTzIfGV3uNpiARuZ2Ua6nSYEhgFGs7PAWVrYLBdtMS7n +JGuEguTfrARG62ahocsWmzna9+5aLLWn0WKbIwHQM4arDamvCDNkdAs25JUuO/uOsNH oqz6mdiqGWZPGci3Jgh74FsAshf5dl6iJSjI4tvDGVhl2Xa2k5AQTaBSK8oUa8mpcAWQ gjBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=1nXRwm/WpKNqqtm4VrxZgexH4E8Mu+qEZ3+U7MSBzSo=; b=edFerBL6rHdKB/2MaUV1qD4y56V1Wx1MvKAxQi1D+flbgGIubPmDm+d838p4fsrnAm 3wUPHUJZiQl6crmDgw0m5/hfSox/rm10XsM+aeCi1D+4S1MfatqyRqIxgF5ZFYhS7net kucIT2zX1ZUmwiYHx65cBJiPEbhYbbBS7c3pFbsebLRXvRr4WF+uIGTe9XqzenVk98b+ iAvQwsdvVyeWgevrqzgF3UuAkQZ80RbgQqlAu+AHv+6tomZqWrbQ8+An47JXbw1+t8Tp wjMLRmZfWi186kl+V3mUdwQUOgG4J6+2BzCSy2/YWIJ+bXseRBeOI2BY8MOD6J6v4a4A MF5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x125-v6si2534855pfb.237.2018.06.20.07.03.31; Wed, 20 Jun 2018 07:03:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754139AbeFTOD3 (ORCPT + 30 others); Wed, 20 Jun 2018 10:03:29 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:59635 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754014AbeFTOD0 (ORCPT ); Wed, 20 Jun 2018 10:03:26 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MQLgi-1fdIAD33Ma-00Tjr3; Wed, 20 Jun 2018 16:03:01 +0200 From: Arnd Bergmann To: David Howells Cc: y2038@lists.linaro.org, Arnd Bergmann , Anna Schumaker , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] [v2] afs: avoid deprecated get_seconds() Date: Wed, 20 Jun 2018 16:02:48 +0200 Message-Id: <20180620140256.19648-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180620140256.19648-1-arnd@arndb.de> References: <20180620140256.19648-1-arnd@arndb.de> X-Provags-ID: V03:K1:D2IUtNlU4CrLGfQ9M6toTnPD6ki57NCPHLPpcZw06Xzz/SUB0U9 mO8PzXDtHfd7+nfk/Q1tg2ZpSPBS6IurcWyZvcOBXzwanjORYaVRt7FvExtgrCgV5XBqg+N ftburCk2W4UxYFWCzG1M6zlMRM1rKj45PtKrbYJZWnd8loeCh9Ek+EH0FS90GwdAadHFcQ6 qzhMkXj02VS0ec3rMql5w== X-UI-Out-Filterresults: notjunk:1; V01:K0:JX+grlsGGQ8=:UJtIxv8EIx48z7Ab3mGSSm w+ls76aguLcDQxbVsDtK6ARTbr7AcgiT48URn2w/sqH+iqCDQJyfttTuHIU6PZKFck0qaCOK7 v/QklA/Pl7cOo6ZimXsNW11ishgoEJcP99I0c+3eUyQBhXIr+3MjjRp9xZNaIeoRtNOAvlDJZ uuYJYCnKhvzKAeiKLOQaN9n2aY6UUxuwxQSAUbQnTlin65HOczk7Wng/bNIfFHZWw1weUXW+U viFquiO73zKWN2fBb1szkMdzB4LAdMdOOf9lYt++mOOrAJqBxqzijmdrYaE8HoF4s8SWwKE0+ QtpBIDwmat8E+EdCR3XGUp0icVDd0177sC5HAUjUBuYX7v0ZIibCCzReB2LTtS0+F8Jl6/dH/ RidTk0kRxkMgaUL3fUvcFYDL06RCDTUdcuT0dVHE1+IXLqSwJU/iG2D+k+Of9vIVxBhXfYeZI QHpruAZ6t4U49Kae5tpAhp5q158HF6gDNgxBoNediS4P6GZDuh1hBFzTAA+I5pFGKc/r9BYVa VIoCpThFJvT9twhfEZG6R+5xRK/ITrZvZuBoMlvg5dVWE/ey6UVVPVkqMV4zMOSsZgDrSw6n4 G0CTt4mJvF53uNJNMc8pcNEFOVcvyw3rwRV5HCvmGihzq80KNFDPwykolVAzru+0n6uBW7ywB ciiWzq7G3PF75J1mQUJGObbSrFRb1sa4p3FSo3clmrp0XwLKcT9lb3au8/d9MkWWbp+Y= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get_seconds() has a limited range on 32-bit architectures and is deprecated because of that. While AFS uses the same limits for its inode timestamps on the wire protocol, let's just use the simpler current_time() as we do for other file systems. This will still zero out the 'tv_nsec' field of the timestamps internally. Signed-off-by: Arnd Bergmann --- fs/afs/inode.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.9.0 diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 479b7fdda124..0507e52e3330 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -213,9 +213,7 @@ struct inode *afs_iget_pseudo_dir(struct super_block *sb, bool root) set_nlink(inode, 2); inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; - inode->i_ctime.tv_sec = get_seconds(); - inode->i_ctime.tv_nsec = 0; - inode->i_atime = inode->i_mtime = inode->i_ctime; + inode->i_ctime = inode->i_atime = inode->i_mtime = current_time(inode); inode->i_blocks = 0; inode_set_iversion_raw(inode, 0); inode->i_generation = 0;