From patchwork Wed Jun 20 08:12:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 139289 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp484334lji; Wed, 20 Jun 2018 01:14:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKa8T2ReD22/oKvwr6cbCFqwcaPBeEHRjZEiCkByUJZb1P7mazS6Z3u1YWlRJD4wDjrmlpE X-Received: by 2002:a65:494b:: with SMTP id q11-v6mr18206850pgs.105.1529482456123; Wed, 20 Jun 2018 01:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529482456; cv=none; d=google.com; s=arc-20160816; b=Mvv0R5Fb4BPDBvvjRYmxjRf0RPbcS7YETifvR61uJyIGXXkrq/fVLK6LIa4VKz84lR A5RVAWTOxK3AZRHmL1ZzNxq4CeUrmDocw8C2/4DTASBex1VHKCrcJxqA89Zxzi3zUYDv AaJtZCFyvSPML68S/oV/jaVERxktUpyVJ8NuMA8arX4ZsoKA6RRenNUyZ4uONRkeYAiL wNWQ98pTUe3o8VMXbVQYLyEdcvUJY0Q+FAlyEtyVnhu1aFEJbE3jtyj1EVXnp3f6ujM/ DP0eNkPAgEj+jYeaXcYDqMNfS85SiplkCBIwGv1GS2PdzgSzIPBW7ZoOY5xbyxBLP71F uPqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :arc-authentication-results; bh=xPqFimTWCZCK9G6e62S251UtTsZaxU+h9ZV+85lZsxY=; b=peWOwD8qXd5CmdULfLt3LiXWe5T+YRYxnlDhYTbCiG8bXle0TA8v9Td8giYm8EurCP iWr08OUhMI48Gr1DTiIT29PmnqAkjSCdlyV3lmZC3LaYYewEYs8b1kxdpM5bXUTR78cF wD1pGIgcGcFSPoiV8zSh+b7OTORnEj0zVlI5G+MX/0yAkm6Si6o7mUVbBcrvKvXQUmKu zK7je/jt0rHvkqlSwFXhPd+/Qwd55NdD7xxUFGxdJL+aYLKWqQ5UF94Jva/thjjeuXoZ 6IJfBS/cNnsZIfXD0SgP/bb0cezKqz0i5I7ipgklEO0Wgcl7DhopPARcfyHzPq2r3Dk+ 8mEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="sA6S3Dh/"; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id w3-v6si1512991pgb.588.2018.06.20.01.14.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 01:14:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="sA6S3Dh/"; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=xPqFimTWCZCK9G6e62S251UtTsZaxU+h9ZV+85lZsxY=; b=sA6 S3Dh/l714lrNC+HqRUkPvEhDJGF0Yv+xT9zzd25n0oLu4iFrhf/Hu05BDJ489Tb4+lUV7u277i8M2 m47WwxhXETgVMNfacKPP1afFMAal9JLyTZ0Tj+5QsecXVwJwK4rh0j6c7pFuRtWIsg7Q9zWo13nya d1jfIx1GBIrEnJhkf9/kVISosH0w/e5PNGeg2Sx8Ud9uQ9AWYEbUozFs+DuOL5cQOtrfqS14TmcXB uOqrlJYEL/rdR7qylvgha+dLmn+Q23GaOULtfyJBUA2Cgw/7DSRsonqnyYUHCBNUGt5Id48j5MwU8 KzHIgcT7KsAuXFu0uE3orUvMOeqG3aA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVYFk-0007sT-EQ; Wed, 20 Jun 2018 08:14:08 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVYFg-0007rN-Qv for linux-mtd@lists.infradead.org; Wed, 20 Jun 2018 08:14:06 +0000 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MRDAN-1fd4NO1bn5-00UeOe; Wed, 20 Jun 2018 10:13:17 +0200 From: Arnd Bergmann To: Richard Weinberger , Artem Bityutskiy , Adrian Hunter Subject: [PATCH] ubifs: use timespec64 for inode timestamps Date: Wed, 20 Jun 2018 10:12:58 +0200 Message-Id: <20180620081311.126158-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:+d/wZIPgnBVV5vfcl8g7Rp8wKUBtcQzct1uGCE6u7aaQce7IfAH +Plnf5d4Y53UsbFissltElr8SWP9GocXGRmLZkjfF1d8x8Xgjk69cTyrIBP8eVoIdj7whog E61a4wPueMjI8w77E0JuPNi8x3Ai6iqNc87v/fLAWRpC8pLyOzHWXUQ0cE77oh7CNguNKO2 hLwiK5QJZbSLm7C6irO2A== X-UI-Out-Filterresults: notjunk:1; V01:K0:WIKWuTF+Du8=:drmoavUKLiKw904OpbhPJi guNDJtm/zsgFTDI71ZZfnz1DNKS9FULCRNsadoo2uQUFtUribG85Ml22HHaelWbqxc1OUy2BA cHLj4V9UUCqJ6CFihrAbq88JduG6nrdkienU97AwrqxXwRLjxXPxhjAUJgrTSv5QGL9ZLHJIb 86XtG1/RAr2n1kpXuGtL6mz+5aFYhHN176zL3Vn5T0CaLtwDkUESc9vEM6quQzyz7lf/ChBtj i0icxy/g/faHQp47P7Y++Y49AiNQQe+UKor5cI6NsTWB+ebjunyrzqP0jqHH3qhHc2ApDpM2/ yek5e7Gq7KvVaQtM1WISLS80BofXUWO31AH5fLe5PFKu6b+GtgqsOiJ1jZuV4uZ82uCnD1U7A AEFRlkKzgWfF8jGD6qXYcr9drJn1lgaCBlRFACsklW5Cbf3gZfqpDE+hoKs1WQtqLUlanC6Yg iozSv5rlpdR0rtKGYKB9QgPVhlZqlzQR3z/4HS818HkoYPNxqJtNBWB5F4Q8WVchy7YtMgA0p /03RsSBOc/EnlQwWspkdWmpI0BXwMGA0/Vvgd2loAGaa+htBTrxy32B2MEpJak0X3pMsNEgkL Z7mQn34y0OlXbx64yWLXau18DJoTYITVhah3MbHJZOTh8GSi8rY9iIrqu6+GlNxbuynDTpbx1 m9/K7ui9eIwA13aPniMq2DlOfB8Ti4T090DcjWXFiPNIPDAaB6rMJcIB/yoeeSa8G2LI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180620_011405_174855_479E32E8 X-CRM114-Status: GOOD ( 13.97 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.73 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kara , Arnd Bergmann , Eric Biggers , y2038@lists.linaro.org, linux-kernel@vger.kernel.org, =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , linux-mtd@lists.infradead.org, Souptick Joarder , Hyunchul Lee , Deepa Dinamani MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Both vfs and the on-disk inode structures can deal with fine-grained timestamps now, so this is the last missing piece to make ubifs y2038-safe on 32-bit architectures. Signed-off-by: Arnd Bergmann --- fs/ubifs/file.c | 11 +++++------ fs/ubifs/sb.c | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) -- 2.9.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index fd7eb6fe9090..02fab5c322c7 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1365,11 +1365,10 @@ int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) * granularity, they are not updated. This is an optimization. */ static inline int mctime_update_needed(const struct inode *inode, - const struct timespec *now) + const struct timespec64 *now) { - struct timespec64 now64 = timespec_to_timespec64(*now); - if (!timespec64_equal(&inode->i_mtime, &now64) || - !timespec64_equal(&inode->i_ctime, &now64)) + if (!timespec64_equal(&inode->i_mtime, now) || + !timespec64_equal(&inode->i_ctime, now)) return 1; return 0; } @@ -1425,7 +1424,7 @@ int ubifs_update_time(struct inode *inode, struct timespec64 *time, */ static int update_mctime(struct inode *inode) { - struct timespec now = timespec64_to_timespec(current_time(inode)); + struct timespec64 now = current_time(inode); struct ubifs_inode *ui = ubifs_inode(inode); struct ubifs_info *c = inode->i_sb->s_fs_info; @@ -1519,7 +1518,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf) struct page *page = vmf->page; struct inode *inode = file_inode(vmf->vma->vm_file); struct ubifs_info *c = inode->i_sb->s_fs_info; - struct timespec now = timespec64_to_timespec(current_time(inode)); + struct timespec64 now = current_time(inode); struct ubifs_budget_req req = { .new_page = 1 }; int err, update_time; diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 8c25081a5109..fa0a982a6797 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -85,7 +85,7 @@ static int create_default_filesystem(struct ubifs_info *c) long long tmp64, main_bytes; __le64 tmp_le64; __le32 tmp_le32; - struct timespec ts; + struct timespec64 ts; /* Some functions called from here depend on the @c->key_len filed */ c->key_len = UBIFS_SK_LEN; @@ -301,8 +301,8 @@ static int create_default_filesystem(struct ubifs_info *c) ino->creat_sqnum = cpu_to_le64(++c->max_sqnum); ino->nlink = cpu_to_le32(2); - ktime_get_real_ts(&ts); - ts = timespec_trunc(ts, DEFAULT_TIME_GRAN); + ktime_get_real_ts64(&ts); + ts = timespec64_trunc(ts, DEFAULT_TIME_GRAN); tmp_le64 = cpu_to_le64(ts.tv_sec); ino->atime_sec = tmp_le64; ino->ctime_sec = tmp_le64;