From patchwork Mon Jun 20 00:27:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9186357 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 725AD60871 for ; Mon, 20 Jun 2016 00:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68A44200F5 for ; Mon, 20 Jun 2016 00:42:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D32622362; Mon, 20 Jun 2016 00:42:47 +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 7BC80200F5 for ; Mon, 20 Jun 2016 00:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751677AbcFTAmm (ORCPT ); Sun, 19 Jun 2016 20:42:42 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36196 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbcFTAml (ORCPT ); Sun, 19 Jun 2016 20:42:41 -0400 Received: by mail-pa0-f67.google.com with SMTP id fg1so9708634pad.3; Sun, 19 Jun 2016 17:42:41 -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=qKaakKRdSenQvwuEUvek87ioxdeGd9FKNCwzC8wS2J8=; b=0wyu0OzznapZpQWJwbqh9jLx+zffaeBqGRINA0ibTowkazEjcqzO1FH4u+N96AV1hF q7gOvCPcREqFmsSDQ4IKa5QANZzp0yIdspXXNqpk/1+yAlrcqT/luTyC0KJA5tKHvF/n zFctIOu8r9SriIY8HisJMVMeYjQmYZ8dL/RjFLX1/aqctDmMIYnsdbbmtGb4IaKtv8cC boriwfBdsoqddkghWr5ybyLSzy1UxfHe5g0DGrLYcGq8UAA8SIoTRJjw6N24PPEHbEwb BTVNtGDFqhh/+C3PQfxriL7yOM/0sZxwVPAMJQiANSNjyJAhDDs2Lobdb8+vDUvToupD TeYg== 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=qKaakKRdSenQvwuEUvek87ioxdeGd9FKNCwzC8wS2J8=; b=OH7BAjwlyMxOLHDzq5s6cwl404NlCCP2cj0KPVRf7QreVfcHii1OCHOoLkzRDMVcJd Assiqa9jFkr+l7+r3C+7gWcKx7WzZkUo4VEaUtb/h9YqhGcY4mFoGrsB/ycBUq+ZGNys 38pnnPooRTLDz+X3HpwfWXJxl4CjrOL7rk6uRF6WNEF+QhattUg3ZT/C+ywsQHl4k5ly +dCeI6qi0/yvdy6tMZVOv3hegaTLv5v16cbC370TdCUPHEHrR0LMbRY8dzIqbN3quxsB Y3zE/ll5PY/JiCwWnAEustlCd6RXqzdx3EtjifIUfMxosTJegSiMndbikpQYi8ajcW0h RmSA== X-Gm-Message-State: ALyK8tJ8tKYlPozBdydxTHmBc40swYwos3ZJ7DAtW3TQcTvagH1djXIZYKsqOQ8/Pz/blA== X-Received: by 10.66.167.103 with SMTP id zn7mr18260682pab.149.1466382511666; Sun, 19 Jun 2016 17:28:31 -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 s12sm34984980pfj.57.2016.06.19.17.28.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Jun 2016 17:28:31 -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, Mark Fasheh , Joel Becker , ocfs2-devel@oss.oracle.com Subject: [PATCH v2 16/24] fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds() Date: Sun, 19 Jun 2016 17:27:15 -0700 Message-Id: <1466382443-11063-17-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466382443-11063-1-git-send-email-deepa.kernel@gmail.com> References: <1466382443-11063-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. Use y2038 safe ktime_get_real_seconds() here for timestamps. struct heartbeat_block's hb_seq and deletetion time are already 64 bits wide and accommodate times beyond y2038. Signed-off-by: Deepa Dinamani Cc: Mark Fasheh Cc: Joel Becker Cc: ocfs2-devel@oss.oracle.com --- fs/ocfs2/cluster/heartbeat.c | 2 +- fs/ocfs2/inode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 636abcb..9158c98 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -741,7 +741,7 @@ static inline void o2hb_prepare_block(struct o2hb_region *reg, hb_block = (struct o2hb_disk_heartbeat_block *)slot->ds_raw_block; memset(hb_block, 0, reg->hr_block_bytes); /* TODO: time stuff */ - cputime = CURRENT_TIME.tv_sec; + cputime = ktime_get_real_seconds(); if (!cputime) cputime = 1; diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index c56a767..382401d 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -703,7 +703,7 @@ static int ocfs2_remove_inode(struct inode *inode, goto bail_commit; } - di->i_dtime = cpu_to_le64(CURRENT_TIME.tv_sec); + di->i_dtime = cpu_to_le64(ktime_get_real_seconds()); di->i_flags &= cpu_to_le32(~(OCFS2_VALID_FL | OCFS2_ORPHANED_FL)); ocfs2_journal_dirty(handle, di_bh);