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: 9186309 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 5E9BA6075F for ; Mon, 20 Jun 2016 00:29:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58468209CC for ; Mon, 20 Jun 2016 00:29:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CDED22376; Mon, 20 Jun 2016 00:29:26 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 84DF1209CC for ; Mon, 20 Jun 2016 00:29:25 +0000 (UTC) Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u5K0T9Z9031629 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Jun 2016 00:29:09 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u5K0T86N002527 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jun 2016 00:29:09 GMT Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1bEn5Q-0004GA-Sd; Sun, 19 Jun 2016 17:29:08 -0700 Received: from userv0021.oracle.com ([156.151.31.71]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1bEn4s-0004Ez-GY for ocfs2-devel@oss.oracle.com; Sun, 19 Jun 2016 17:28:35 -0700 Received: from aserp1030.oracle.com (aserp1030.oracle.com [141.146.126.68]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u5K0SXuF026109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Jun 2016 00:28:34 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by aserp1030.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u5K0SXJf017607 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 20 Jun 2016 00:28:33 GMT Authentication-Results: aserp1030.oracle.com; dkim=pass reason="2048-bit key" header.d=gmail.com header.i=@gmail.com header.b=0wyu0Ozz Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.16.0.11/8.16.0.11) with SMTP id u5K0RAEZ037412 for ; Mon, 20 Jun 2016 00:28:33 GMT Authentication-Results: oracle.com; spf=pass smtp.mail=deepa.kernel@gmail.com Received: from mail-pa0-f68.google.com (mail-pa0-f68.google.com [209.85.220.68]) by userp2040.oracle.com with ESMTP id 23mvx4c906-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 20 Jun 2016 00:28:32 +0000 Received: by mail-pa0-f68.google.com with SMTP id fg1so9691993pad.3 for ; Sun, 19 Jun 2016 17:28:32 -0700 (PDT) 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=O8O7GzTQvldlnDf05zPIJ/LSrUrz3+8Ifmv1kqWla2zIwZQ5tcZOAS18sJal/OM8Cv Rhf9wRK1pFN2/GJW4puvtFtI8WlAYJ8EsxMziHbgG8Hd7X2zj5P9P372Td1G+6k0GReR tHMBvbmqBN7AYq7xuuWtEyxH0VGwRg2DOevSywwlyiYFe9vtECQoSjR8EWTSBMHR55TA BTEUtfVGP3ZluWqmducU3PAXiUx6k2Dvk1w4+WlNQTE7E8WOL4N265Q5r01sml0WXE5N 0QXSzGz8QTwgU4YSNIFYu8IR6/hG53dfx/6wvX5uBLFjQtRWOV165/q2hGEPBqkrEkXt tVQg== X-Gm-Message-State: ALyK8tLzhxdORGQh8iB3wXfDEJMy2hDfO1qng3KbxbOvIZ2nt/iviIjQOWz+R4e1hD9RTA== 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 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> X-ServerName: mail-pa0-f68.google.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 redirect=_spf.google.com X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8201 signatures=670740 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606200004 Cc: tytso@mit.edu, arnd@arndb.de, y2038@lists.linaro.org, Mark Fasheh , viro@zeniv.linux.org.uk, tglx@linutronix.de, torvalds@linux-foundation.org, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH v2 16/24] fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds() X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: userv0022.oracle.com [156.151.31.74] 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);