From patchwork Wed Jul 11 09:14:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141698 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp48202ljj; Wed, 11 Jul 2018 02:14:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfzyB1jQbNWivKRNlm3X6jeQoXjFIlbmtuyZTi401PUSJ+FyTs+yIaeVZmgnhMYmsyHD2Pl X-Received: by 2002:a65:5b8e:: with SMTP id i14-v6mr21448194pgr.242.1531300495306; Wed, 11 Jul 2018 02:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531300495; cv=none; d=google.com; s=arc-20160816; b=V4EZGjXpb39aeoQjSN4/dKjbnKK3PQw/prtVZiUMR56IsY8uhrTXcCSEr7hHA7nb8t Yjs8kS8bK3PTZa/ObtLcYjTR7XQDlBioFJBtbj1ynC/QuyJITQlbOU4jKzYWHheisMKU yerwuvvrCCtTkPOOMomaDGw5qtCX+aNpRy3IThjpXvfWUTBTE2OKOuGAKj0Cll4w9Z9j 3X8GKto2nnTeLLxp7KeIGJ0fc1sS9dci/X+weXP4TSsXwnfQjMZ6obQxQg50tCsFBSKT sZnGYRixIGZRat03+HF382FFcNJ+6C1hQ1pan0xevphs8gM9ytyXSMAifCEydErOZC1J CILg== 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=GeOUsWlvadVTW391909d1hb2SuNXdXdFanBBQIHFg6I=; b=dhxY1y6FC/5HTk0BQhtRewiNwQsn8jxK1rslnuXoSDRSlwb2N1BJifhUm+yA++QKpu CA7k+IGp5EFpm5QJ9lfX6DC180GRjQa0amZrsO4tv2XsrNlAWd8CrmHMO4SXzIbA9xE4 ORlvffhM9txx0Bde41V5XLJzTClk1c++zGgliEQNgrLhF0XaMKmw3nUs9aN3E0011Zed Y6ILQHWA/irvwgjAqG3qNAnqe11ewctKXlEtuYhciBymiDeHfWJM9rZH0ZGKrMibokSD AJnUzsl64hl2w1wOTXnHsbRFPdg5OE4qRs04E+rlAPgeNTjqbZK07isfCTkacHkEG+m2 Nh2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 c67-v6si20079503pfa.130.2018.07.11.02.14.55; Wed, 11 Jul 2018 02:14:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726703AbeGKJSN (ORCPT + 13 others); Wed, 11 Jul 2018 05:18:13 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:34731 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbeGKJSN (ORCPT ); Wed, 11 Jul 2018 05:18:13 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MHpFN-1fe09c0kQ9-003b7L; Wed, 11 Jul 2018 11:14:49 +0200 From: Arnd Bergmann To: adilger.kernel@dilger.ca Cc: arnd@arndb.de, jack@suse.cz, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, sirmy15@gmail.com, stable@vger.kernel.org, tgnottingham@gmail.com, tytso@mit.edu, y2038@lists.linaro.org Subject: [PATCH v2 2/6] ext4: use 64-bit timestamps for mmp_time Date: Wed, 11 Jul 2018 11:14:10 +0200 Message-Id: <20180711091414.1494843-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180711091414.1494843-1-arnd@arndb.de> References: <20180711091414.1494843-1-arnd@arndb.de> X-Provags-ID: V03:K1:9KIdbbQHbE6BmsF9QS6CE0VZGaLOATdivJmOebBq+U+ibEFUsDJ Is1BBABZEJivi6E85kYeXu43lgaCw21XcC2NMi5/FdBXwmx7GJEnEnjTOXTRByt9wxear5s S7Zg/wb972C3ezH6dFdR3UgL/gdK7rJJqxR0h9ctk4z6yMQm2jgTxM60iDvF9g2Ahj/pbQU tFQ+tb+ZBVJjLl4lmYPag== X-UI-Out-Filterresults: notjunk:1; V01:K0:bq64pgaBvEc=:uAfBXobQm2ytQkwu68BoFG QZ3nPwDTMoco9xYM7diFqXMlR0NnVfv+5QVSJjlDhrt6Pr0wAzpdAvlwnYmReyMaHj/txRCXK pZwMD4/YnYaklMv3eci9bxOgV6IKXMa/ZuJgADCmxc8NHpMqCPFsmIR0lQ/OpRckDVtbxWxd7 4BAXQCmsgJR/vwc+iTRJ4JzY4Y2F+7hqPQMXu2ud6x/iSbWrGrenLD0ldhLIx/BR+UoaHTTqA DynC8/JjT8G4hfhLafCwIwNwznnOEq59g8HOzovA1Cjpu/Bkl/l6NK5k2EIjuzqSBD3w/nYoS Xs+EvEfJ6hQxDnT8Hoy4VmLEHacntS2H1ohPv8kjd/kOq9y4wLVXC77b9X+CZUC4cOO0dtFy1 H8/3ecXG70s/snYXdTT7etChOxTiK8qYqZ408beGQGau0VsM6eFqRV+U2RQsIcmysgduqqcgv Q2Y/SsLp7VFq/2f3np6OM6fWoDqZmHCdQW4lamFsqh7h1TmKZnDaYtWJ+5aHID8Gi4zTa1k30 J0uSF/nhEDPYOhtThMuRrS97kWAKNaS0F3bCj4MhNzOTVJUbX2Ywe+DWsly4mcpY1iphz9Gl+ dXT6HizkhrPQIcvkrqCTMzcwdLwGS3eY5YzU/Xin5ehI1uwfGqSgdW+epp/BmmSpDpD6pwuYZ 2w36o4+s195WI3Su2mh35Y3uTaQLJpCGofDxfBhlAcUL8KFg7cGqJD3mxEWwH5B3O5XA= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The mmp_time field is 64 bits wide, which is good, but calling get_seconds() results in a 32-bit value on 32-bit architectures. Using ktime_get_real_seconds() instead returns 64 bits everywhere. Reviewed-by: Andreas Dilger Reviewed-by: Jan Kara Signed-off-by: Arnd Bergmann --- fs/ext4/mmp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index 27b9a76a0dfa..39da4eb48361 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -147,7 +147,7 @@ static int kmmpd(void *data) mmp_block = le64_to_cpu(es->s_mmp_block); mmp = (struct mmp_struct *)(bh->b_data); - mmp->mmp_time = cpu_to_le64(get_seconds()); + mmp->mmp_time = cpu_to_le64(ktime_get_real_seconds()); /* * Start with the higher mmp_check_interval and reduce it if * the MMP block is being updated on time. @@ -165,7 +165,7 @@ static int kmmpd(void *data) seq = 1; mmp->mmp_seq = cpu_to_le32(seq); - mmp->mmp_time = cpu_to_le64(get_seconds()); + mmp->mmp_time = cpu_to_le64(ktime_get_real_seconds()); last_update_time = jiffies; retval = write_mmp_block(sb, bh); @@ -244,7 +244,7 @@ static int kmmpd(void *data) * Unmount seems to be clean. */ mmp->mmp_seq = cpu_to_le32(EXT4_MMP_SEQ_CLEAN); - mmp->mmp_time = cpu_to_le64(get_seconds()); + mmp->mmp_time = cpu_to_le64(ktime_get_real_seconds()); retval = write_mmp_block(sb, bh); From patchwork Wed Jul 11 09:14:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141699 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp48232ljj; Wed, 11 Jul 2018 02:14:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc47vik+0e0HUBwNl/b/48MSP6YwJPJhURSbHOcbphx10Hja39iwcIWd4Xd9fj0N71aVxkM X-Received: by 2002:a62:9541:: with SMTP id p62-v6mr29068885pfd.152.1531300497953; Wed, 11 Jul 2018 02:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531300497; cv=none; d=google.com; s=arc-20160816; b=b4V4T+dkXNBkPuosQBJdrlAm5DvBXVA9FvQBU1iduqj/9zlY62IXklIFlHu+1CEkxq RLb8ENNr0xvEyVP+7Rt9w965GTnrd22yzpFBMcCzQNSXJ8kieY/szQWt+Ca6atkHxhgw QXtEZbl1On/kHywQOAtOcwFWGWqi4wTUZx15R/ETguAyUEsaLaA3KeSL5A4UAViWh+DR F1fIQws6jbg44TfVlmp0riPXKdLjAs1hqs3dE864psBqrjilg0LtuwgUvGuCWxlLGgFl w7AwFI1+eGo2zrEnmHvY0edvmyAb4NKNC2AQh1nAkR5wzdGwhpr/YhQRa9mbI5JaFE1b fDtw== 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=J0nt/QHDSR4+3EZ89pw0hSW/kzrHFEjgONoh7pawe2E=; b=pvLV4KGLoVX/dx/2jOjFxiW4wEx23TX6/7G7Q9ZUek11Ijui3CsPcHX3mSQrCRhi9p kMxu8hIGrjFp4YYW4oZVZ5UcflfSLLpN7IaECrf+317vXesngdLWqANK2XaYucV8s1Je P47fzgpDMssZL24rafUtYdF489PeHIaEC5S29Baot+da4BgkN6GWY0/Q1mOY17MAKEQR 1vihm3uDjY77NKFYc5EIvkKhOF29Ixs3GWRd2ul5J/9GXgtOPDLplzr1/vf+UNKHfjVG VhYL8VONj/xWKN9k+cTCgAAFv52IeCSLRfHW/IjgNgPYjp4RgTjjfsSzqPpJXAI3Hbx9 d4Cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 g35-v6si15861625pgm.54.2018.07.11.02.14.57; Wed, 11 Jul 2018 02:14:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732497AbeGKJSP (ORCPT + 13 others); Wed, 11 Jul 2018 05:18:15 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:48621 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732366AbeGKJSO (ORCPT ); Wed, 11 Jul 2018 05:18:14 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MeBaA-1fRZZv2gqk-00PvCC; Wed, 11 Jul 2018 11:14:49 +0200 From: Arnd Bergmann To: adilger.kernel@dilger.ca Cc: arnd@arndb.de, jack@suse.cz, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, sirmy15@gmail.com, stable@vger.kernel.org, tgnottingham@gmail.com, tytso@mit.edu, y2038@lists.linaro.org Subject: [PATCH v2 3/6] ext4: use ktime_get_real_seconds for i_dtime Date: Wed, 11 Jul 2018 11:14:11 +0200 Message-Id: <20180711091414.1494843-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180711091414.1494843-1-arnd@arndb.de> References: <20180711091414.1494843-1-arnd@arndb.de> X-Provags-ID: V03:K1:aLZZDLe4yh9mM/SxxZyq83TZgByo8/3I999hKbspb10a+AXFU3A vKFh9z44EXJwcmC7zLSDiyqiBL67c9CZ7SqDIAG5nbOwcjS0fqtEFsdJmn5ck5ssz40FPEd EmZv4J4TZ4LiTuW9RudvUaclouFuj5C7q4HjqodyZt5+JFDbkJV7Yp0I/HpOgOROrSx2zP7 9HgMNbB9sIF5HfrjX0VXQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:pLJ0P+786jA=:Nz5demrXIadNQ/i7ERRua8 KKWf+iPFJHwtQH5E4HrAJ078q2cfj4rtDTk2TJGTr3raClkDqz5YVs+3zMhKWsAR2Mixql3Os 8rvY6RX9yV8vrrUqKnYBNZkDrt34L7UAMPotPdAyv49ky9zn9PbdGIGIF6KuAxIEeO50PeHlX 8yGyi0sn3OhRxoUzHJWCkIQlaNCBbLnDlmSCGUrOCYqz6L6TESyHBX9K/fUDtGm7gTKNteh8y F4jRiwv6jzH0/nameYSOEk6RXo2L42DQosx5SHPVestayI1Jq9LFr/0zi7L6by4UyziAKxNMy T7mPCMBhTvEZdTbwvJ5uor7SRs4G+nIprLSDwhWKzNnwhsxUQFQEqAORCRET06QhmhEYiZkri CeVeN4YMkccPQEkY4WvOfFpdv1C6y2DQ7fPBgE6tvouQHWlzyIDD5gd+RehB9NQ2ArDLggnfF 8pHgvhnhwydjzpw0toB6F1ACpya8femVj6gMeqxIYD4+QdxBzeYHuYJqRU1UPpau3mMvF0gMA hUsNcz7hLmGmrGMuiCtMF6Hem4FLPSstfGMKC0N9fHf11Ug2Adg0g4sozSWvTG+UZhspUCuml MdkkAj7FyL6S0PgKh93/FwKd11BSNFteTX4Z2NdBgszcWu9p7CEa1KemNp5HxgtciG9j4JuPv xW8LfLvOu2xYSF8q3G6/2OoBmUVCBx4qjoCy1RbmFB/s27jZOSLmKZilfkNInY/C4lDY= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org We only care about the low 32-bit for i_dtime as explained in commit b5f515735bea ("ext4: avoid Y2038 overflow in recently_deleted()"), so the use of get_seconds() is correct here, but that function is getting removed in the process of the y2038 fixes, so let's use the modern ktime_get_real_seconds() here. Reviewed-by: Andreas Dilger Signed-off-by: Arnd Bergmann --- fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 74982a9566a9..3b54227cf2b1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -317,7 +317,7 @@ void ext4_evict_inode(struct inode *inode) * (Well, we could do this if we need to, but heck - it works) */ ext4_orphan_del(handle, inode); - EXT4_I(inode)->i_dtime = get_seconds(); + EXT4_I(inode)->i_dtime = (__u32)ktime_get_real_seconds(); /* * One subtle ordering requirement: if anything has gone wrong