From patchwork Sat Aug 13 22:48:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9278743 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 26E856086A for ; Sun, 14 Aug 2016 10:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19A43289F3 for ; Sun, 14 Aug 2016 10:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 078E428A58; Sun, 14 Aug 2016 10:39:40 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 AFF2C28A1A for ; Sun, 14 Aug 2016 10:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753005AbcHNKjK (ORCPT ); Sun, 14 Aug 2016 06:39:10 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36816 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752268AbcHNKjI (ORCPT ); Sun, 14 Aug 2016 06:39:08 -0400 Received: by mail-pf0-f194.google.com with SMTP id y134so2108868pfg.3; Sun, 14 Aug 2016 03:39:08 -0700 (PDT) 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=dQAG+PaHJzTuTfWamYZk90b2ATeWTg3HzEwwnWKlB3o=; b=hKmMcjoskHGiUNKNssGIybHPDJXr4JcdgQnN5z30a1TwDk4oV9PlVvVtDX8neHEaP3 VYOQBbg/6i3kXDkKY4xB/KxR1hCwIQ0Q8gisuSnTmyk9OeY9eQVZRflfwQCxX1oRjJSL pBWBzqRs+hZFz/q1usgESdXRd/G9FiBmThz4kPtvUBBX4QynbMlpwxxnItyM3c4RkDBQ YIJJMVeQmDjkL8pd/sIYuv4GeVzUx5vPf9tWC0x8M0KvT9wX6YMLGnh3dS7mTjEHCXpY 4XYqD3sny/xK35dea6p8RlOr+WNeqn4U5hRv8rXLznfyb/cqxkueWC6MbbCv3Bss4FIh nE6Q== 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=dQAG+PaHJzTuTfWamYZk90b2ATeWTg3HzEwwnWKlB3o=; b=ia1slffW/D5cNLxjtyfhGJZYNc6pO7zwN1zeJM1cYQUfGClGNUE3oq8QmISUklHAVC a+VSMS0FBRo26LeE0YEqMCAyewkRBokqaEb0qN1v6HviWz3hvp846mXqtGSKZ0KjTyq4 ws45n68cZQ/MgMkM9GuyBRilp0QvicLDKFF3CNRAEJnCLe3uSgxAjhtXChqyGXI4Pe9V EXDvxQPkK3eKCy300XFuOJhNhDtyEgmYG5N8rpKEa5okhCVlZ1v/xNxbJaAzdwxM08zm qlw/Z5qVx1WdlkiSBlvwgjNsY0w1psjXnTNZiICUpJVzbZTAhns00v/GHwGTShAAPi8/ Mhpw== X-Gm-Message-State: AEkoouu1kq5W2r2FA+MZirBBWUo3Z3Kde16K6gLnoKV5QSup9ZpwmiJEDv8Qi3ABPlwv5A== X-Received: by 10.98.152.129 with SMTP id d1mr40537670pfk.126.1471128563696; Sat, 13 Aug 2016 15:49:23 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net (c-73-252-251-201.hsd1.ca.comcast.net. [73.252.251.201]) by smtp.gmail.com with ESMTPSA id 81sm22528007pfm.90.2016.08.13.15.49.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Aug 2016 15:49:23 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, tglx@linutronix.de, torvalds@linux-foundation.org, tytso@mit.edu, viro@zeniv.linux.org.uk, y2038@lists.linaro.org, Evgeniy Dushistov Subject: [PATCH v4 06/26] fs: ufs: Use ktime_get_real_ts64() for birthtime Date: Sat, 13 Aug 2016 15:48:18 -0700 Message-Id: <1471128518-24075-7-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471128518-24075-1-git-send-email-deepa.kernel@gmail.com> References: <1471128518-24075-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-Virus-Scanned: ClamAV using ClamSMTP CURRENT_TIME is not y2038 safe. Replace it with ktime_get_real_ts64(). Inode time formats are already 64 bit long and accommodates time64_t. Signed-off-by: Deepa Dinamani Cc: Evgeniy Dushistov --- fs/ufs/ialloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index 9774555..d1dd8cc 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c @@ -176,6 +176,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode) struct ufs_cg_private_info * ucpi; struct ufs_cylinder_group * ucg; struct inode * inode; + struct timespec64 ts; unsigned cg, bit, i, j, start; struct ufs_inode_info *ufsi; int err = -ENOSPC; @@ -323,8 +324,9 @@ cg_found: lock_buffer(bh); ufs2_inode = (struct ufs2_inode *)bh->b_data; ufs2_inode += ufs_inotofsbo(inode->i_ino); - ufs2_inode->ui_birthtime = cpu_to_fs64(sb, CURRENT_TIME.tv_sec); - ufs2_inode->ui_birthnsec = cpu_to_fs32(sb, CURRENT_TIME.tv_nsec); + ktime_get_real_ts64(&ts); + ufs2_inode->ui_birthtime = cpu_to_fs64(sb, ts.tv_sec); + ufs2_inode->ui_birthnsec = cpu_to_fs32(sb, ts.tv_nsec); mark_buffer_dirty(bh); unlock_buffer(bh); if (sb->s_flags & MS_SYNCHRONOUS)