From patchwork Sat Jun 25 21:37:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9198763 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 C80406075F for ; Sat, 25 Jun 2016 21:41:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE52C28527 for ; Sat, 25 Jun 2016 21:41:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B25642852B; Sat, 25 Jun 2016 21:41:29 +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 3C69128527 for ; Sat, 25 Jun 2016 21:41:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751842AbcFYVlK (ORCPT ); Sat, 25 Jun 2016 17:41:10 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33694 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbcFYVil (ORCPT ); Sat, 25 Jun 2016 17:38:41 -0400 Received: by mail-pa0-f65.google.com with SMTP id ts6so11972505pac.0; Sat, 25 Jun 2016 14:38: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=h+HnZTsLwJq3MKIr4XgWXoHDTCodeZUP1GDRMwhinCP5JIJpUED6UhLztmXXw69DdQ v0INWjfaJZw0tAtHDSYv8vZSDXjGbScuqJiweDyv5iqHsE2yY3SzjGgVMit0wOuz33qQ IfW2faZM0Q5OyCjNRm/DpU7CV9CmgLwjizi1/Lh1APV16b8jfZwG9+gh9H83RV39iRuU 5B0oRNxAjLPR1IpIKITQMat3v/VpLdyZf98vNy7dC5AyU5dx1NpwHbH2AFMegyDsWzMU Ky40tkrCOEGinF9nc4DTQU4sLzDNbI+amMfkg18Dx9ODAEIT9yjHDEOBWFTf/mAWzX9P lqUA== 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=SjZK5DDZw2OSUzPkIKITZReVJYHOh99pn7DZ3F9/9wO0pmQzAcUAGRkVNAluP+VVMx 5T+YDSlPBu9w9G+PBOeIhF5IeE20qKLm4sradoQzzNcIXlSnTTHdFaf/Wzr05YygMZS2 CYp2xB1T7Ovgkp79y938Bzkx/VO3DVpmesNsLlxKhyQ4J7XSlFG9u3TJScsU60MvM3CG PTn1/n65ZpzRe8a/FCcFjN4q2rp5iLh0eyrXh2KHyckgsvJKnrztKlKu3/Z3zy+hqBSK ql9t1U9OVId2BYhg7RYmXYUOJsRFmD+ifvcv4AQvfSt3Mib+aRBztdozcNERivjqF2JR JCBw== X-Gm-Message-State: ALyK8tKct3eC3jaa3+B1mt44s7tp+RcVrNa9IM4SuF8pcipOilZ52ckGCro+LCAVPrVtuQ== X-Received: by 10.66.134.35 with SMTP id ph3mr19794100pab.98.1466890720834; Sat, 25 Jun 2016 14:38:40 -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 m8sm1861308pfi.27.2016.06.25.14.38.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 25 Jun 2016 14:38:40 -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 v3 17/24] fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds() Date: Sat, 25 Jun 2016 14:37:41 -0700 Message-Id: <1466890668-23400-18-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466890668-23400-1-git-send-email-deepa.kernel@gmail.com> References: <1466890668-23400-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);