From patchwork Sat Apr 8 00:57:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9670835 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 A5E5A602B3 for ; Sat, 8 Apr 2017 01:03:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97C42285FE for ; Sat, 8 Apr 2017 01:03:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C41228633; Sat, 8 Apr 2017 01:03:09 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 3ADAA285FE for ; Sat, 8 Apr 2017 01:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934077AbdDHBDH (ORCPT ); Fri, 7 Apr 2017 21:03:07 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36070 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933687AbdDHA6j (ORCPT ); Fri, 7 Apr 2017 20:58:39 -0400 Received: by mail-pg0-f67.google.com with SMTP id 81so18669244pgh.3; Fri, 07 Apr 2017 17:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SYapJWi3vYDlTgVCg/WED97mtwAsNZcEYhrlAp9lU6I=; b=kIA8B0+ej7R/panBNDjCsH7nBWc6L5ruYF9RpSdxEDtMnQyL45LN5DBCvFLuxlXIiO 9BpZlzyLjIUyS85anhnXVpLOl9RZ0HdHGVcky0kuB0VMaS4rg6A9CCSX+pJdSNjMhQjk jaOKPzJXXwLb8nqegS757+IXZ8YcmZDQq1VQFZOVigaBVAuv+2TKwOjG/CQ3wm5vQBcK D/naX2pgLCHqaOtIuLLoekMMrQ9nW0JBy0OpOEPZvbvvdrksqY/94gbOyNA0MVaL749v O7hVXY73chsXOxwR963Em7oyPDSl3krWH6rg6zT9Me/oRo4jxxj2FFSGrHBjpCpQ2RWL 3p1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SYapJWi3vYDlTgVCg/WED97mtwAsNZcEYhrlAp9lU6I=; b=M4LOuFY+wFhswVADhxuFCBMyAmPInyNzeA/j6Jifjl6WPNXSk03oLbiZmi1xEu456s AVxDsK5MQXJ8iKyBuvy/BNxFx6XtIBnpayOPtRTM5Vvp7nFBumF+AHmYJ6OeeWA0Siza THl2N+Wk6uafMZjNxlLO4HyTJ2pdMKjM+bQy+h40qvG2Aid4wYesbU6lOpxXMzk5g3rp BRaMcHkhHi7KYgb2fN09V2G5QAbGlkEpTd5yjAXUPBhz2PHortI7NxvA389Djc+o7yT+ Y6ZlLqONBuf/LY4mFj94AaGI+TjBc7tmyp594KA51dNxAJWdctLZLhVGl8MteP1iUBnj IM3A== X-Gm-Message-State: AFeK/H3vH6BZ/sh2AwcL9eEzNRpC0D85QWtqu2zJfAaORc0uJIpoLaTrxdOZoL5Bn8X8Ww== X-Received: by 10.98.215.70 with SMTP id v6mr42573577pfl.121.1491613118624; Fri, 07 Apr 2017 17:58:38 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net ([2601:647:5000:6620:95ed:e0d8:7705:f3cc]) by smtp.gmail.com with ESMTPSA id b8sm11638130pfk.39.2017.04.07.17.58.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Apr 2017 17:58:38 -0700 (PDT) From: Deepa Dinamani To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: tglx@linutronix.de, viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, andreas.dilger@intel.com, arnd@arndb.de, bfields@fieldses.org, clm@fb.com, davem@davemloft.net, dsterba@suse.com, dushistov@mail.ru, eparis@redhat.com, jaegeuk@kernel.org, jbacik@fb.com, jlayton@poochiereds.net, john.stultz@linaro.org, jsimmons@infradead.org, mingo@redhat.com, oleg.drokin@intel.com, paul@paul-moore.com, rostedt@goodmis.org, yuchao0@huawei.com, ceph-devel@vger.kernel.org, devel@driverdev.osuosl.org, linux-audit@redhat.com, linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-security-module@vger.kernel.org, lustre-devel@lists.lustre.org, netdev@vger.kernel.org, samba-technical@lists.samba.org, y2038@lists.linaro.org Subject: [PATCH 05/12] fs: ufs: Use ktime_get_real_ts64() for birthtime Date: Fri, 7 Apr 2017 17:57:03 -0700 Message-Id: <1491613030-11599-6-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-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 --- 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 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode) 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)