From patchwork Mon Jun 20 00:27:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9186305 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 D6C6C6075F for ; Mon, 20 Jun 2016 00:29:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD318209CC for ; Mon, 20 Jun 2016 00:29:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B83F222376; Mon, 20 Jun 2016 00:29:17 +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 70039209CC for ; Mon, 20 Jun 2016 00:29:15 +0000 (UTC) Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u5K0Sq51031251 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 20 Jun 2016 00:28:53 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u5K0SlcG030080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jun 2016 00:28:48 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 1bEn55-0004FP-Q2; Sun, 19 Jun 2016 17:28:47 -0700 Received: from aserv0021.oracle.com ([141.146.126.233]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1bEn4q-0004Er-Gl for ocfs2-devel@oss.oracle.com; Sun, 19 Jun 2016 17:28:32 -0700 Received: from aserp1020.oracle.com (aserp1020.oracle.com [141.146.126.67]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u5K0SW7q029732 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Jun 2016 00:28:32 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by aserp1020.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u5K0SVvB022604 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 20 Jun 2016 00:28:32 GMT Authentication-Results: aserp1020.oracle.com; dkim=pass reason="2048-bit key" header.d=gmail.com header.i=@gmail.com header.b=QsTqAF4U 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 u5K0R5jm037158 for ; Mon, 20 Jun 2016 00:28:31 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 23mvx4c8yt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 20 Jun 2016 00:28:31 +0000 Received: by mail-pa0-f68.google.com with SMTP id us13so9671802pab.1 for ; Sun, 19 Jun 2016 17:28:30 -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=KbfRFyNeWv0ySmdXJDB6YA3PMgiktfxtvd81El/k6uc=; b=SIjvEwvKTmZiVhxmKNoUKbyFm61oU3dhR+0wLh1Xs7lWc82vtnuBg+E1Kxz+noKxxY kN+3FdK5w6rs2T4fBVTUvcBJrmsu9mJdRnVXZmu/hq5fGkAsDnBxe73LR2J3D7l6UcMQ S+kOqpuCl9/4NBZ0q3hnTZsKGZBjNnRP9143HS+NGCk1faENoyFWsT0PJ3rXxgAJ6zpD 8ZUEY3h1fazuznKU/Txo5SgWVIlKX0WQo3YTh9oUGiuG4sK8rtHrzFxvk3+5RPwxhHE1 0SG0SJ9Cw3Ct/xUI8FpTTOsjglpagpgFWcaex29woE00+FvMPs28P6RLgsV8Uyev7A74 BZTQ== X-Gm-Message-State: ALyK8tIS/ti6UV0Ktokk7V2CSwOMEZPuwzNquZccKrFG/ng311AeoqXLe+9OD1pRuTf+2w== X-Received: by 10.66.248.3 with SMTP id yi3mr102077pac.61.1466382510025; Sun, 19 Jun 2016 17:28:30 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Jun 2016 17:28:29 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 19 Jun 2016 17:27:14 -0700 Message-Id: <1466382443-11063-16-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 15/24] fs: ocfs2: Use time64_t to represent orphan scan times 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: aserv0021.oracle.com [141.146.126.233] X-Virus-Scanned: ClamAV using ClamSMTP struct timespec is not y2038 safe. Use time64_t which is y2038 safe to represent orphan scan times. time64_t is sufficient here as only the seconds delta times are relevant. Also use appropriate time functions that return time in time64_t format. Time functions now return monotonic time instead of real time as only delta scan times are relevant and these values are not persistent across reboots. The format string for the debug print is still using long as this is only the time elapsed since the last scan and long is sufficient to represent this value. Signed-off-by: Deepa Dinamani Cc: Mark Fasheh Cc: Joel Becker Cc: ocfs2-devel@oss.oracle.com --- fs/ocfs2/journal.c | 4 ++-- fs/ocfs2/ocfs2.h | 2 +- fs/ocfs2/super.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index e607419..df76e60 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -1946,7 +1946,7 @@ static void ocfs2_queue_orphan_scan(struct ocfs2_super *osb) */ seqno++; os->os_count++; - os->os_scantime = CURRENT_TIME; + os->os_scantime = ktime_get_seconds(); unlock: ocfs2_orphan_scan_unlock(osb, seqno); out: @@ -2003,7 +2003,7 @@ void ocfs2_orphan_scan_start(struct ocfs2_super *osb) struct ocfs2_orphan_scan *os; os = &osb->osb_orphan_scan; - os->os_scantime = CURRENT_TIME; + os->os_scantime = ktime_get_seconds(); if (ocfs2_is_hard_readonly(osb) || ocfs2_mount_local(osb)) atomic_set(&os->os_state, ORPHAN_SCAN_INACTIVE); else { diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index e63af7d..7e5958b 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -224,7 +224,7 @@ struct ocfs2_orphan_scan { struct ocfs2_super *os_osb; struct ocfs2_lock_res os_lockres; /* lock to synchronize scans */ struct delayed_work os_orphan_scan_work; - struct timespec os_scantime; /* time this node ran the scan */ + time64_t os_scantime; /* time this node ran the scan */ u32 os_count; /* tracks node specific scans */ u32 os_seqno; /* tracks cluster wide scans */ atomic_t os_state; /* ACTIVE or INACTIVE */ diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 3971146..6992c00 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -337,7 +337,7 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) out += snprintf(buf + out, len - out, "Disabled\n"); else out += snprintf(buf + out, len - out, "%lu seconds ago\n", - (get_seconds() - os->os_scantime.tv_sec)); + (unsigned long)(ktime_get_seconds() - os->os_scantime)); out += snprintf(buf + out, len - out, "%10s => %3s %10s\n", "Slots", "Num", "RecoGen");