From patchwork Mon Jun 20 00:27:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9186397 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 25A6160871 for ; Mon, 20 Jun 2016 01:28:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11F51205B0 for ; Mon, 20 Jun 2016 01:28:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 065C2219AC; Mon, 20 Jun 2016 01:28:27 +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 7727A205B0 for ; Mon, 20 Jun 2016 01:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbcFTB2Y (ORCPT ); Sun, 19 Jun 2016 21:28:24 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:35670 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbcFTB2W (ORCPT ); Sun, 19 Jun 2016 21:28:22 -0400 Received: by mail-pa0-f68.google.com with SMTP id hf6so9738358pac.2; Sun, 19 Jun 2016 18:27:38 -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=C8zMAmfIWmhWMWCMVnlMMNdDJsA5R3F7KVCDP7GVxtk=; b=qrNCu6vXqgsvXXmCLTKYALYQ7o0MGqAxtwf6JWKSJILo67s6WHLOD6JYUH7m5V6rrL GtiyDF0Tf+YM+SI36Imhxvn9fh9K9maHMHk2KJKzHeMyUFswQ/tuxJia+PT+4g08stBi M91o4M1zWHrsS1OfPvx/lteb3gMQdox7K/0ZZTjhzeWnPth1jtGANRtYywMU5XouzeTk lB2qsbFD5+YhepeIizU/REM35/D+LqrDNzRjymEs0WEU+uK3+nDSPCxfgwnJ6ekaJbpf 9vy0WjmjwgEkG3L1qFOtolYE1S4vHEMK2lrVYYgC5l1kZ5NeJdvZK/HUjxeL8GsncKmS 6Urw== 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=C8zMAmfIWmhWMWCMVnlMMNdDJsA5R3F7KVCDP7GVxtk=; b=JaBoD8h5JMbtqUEXaglXq/n0KgaGx8qH3y7usDRVPyaJQ7HCRVKIScQSzG3OQmEeTS Dck70mB1yjDsWb+PEZ/J5E+trDmY5+COMudjhcPoAgkCy3lduN70op9ZvKMf4s80zPqS Mb1hnU0wDdJ2E3TWhvRA78XvFFf4IqLbRKRpIpiRGAYOFf0ab9ZJRp91WizrcqAQ7bpW DKMseHN+59grrykH7HPeypnm48XzE+eGFK3FJI7Q7/T9qKi4NOq7awzM9OdocgWZv2ja oOx4XLVGP1peMAxpnxx/6F3Np4LITPjcjtYDNs0WWSN+PZgfOlm+mngz+0Qyned3+XzV OYVw== X-Gm-Message-State: ALyK8tJjHlPILLOb7wbLHiIf5Q+9snkwqrgW1S1Latzjez1hiyP9yN3aUWN/Rw+M0ioJlA== X-Received: by 10.66.73.71 with SMTP id j7mr18416031pav.109.1466382517486; Sun, 19 Jun 2016 17:28:37 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Jun 2016 17:28:36 -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, Hiral Patel , Suma Ramars , Brian Uchino , "James E.J. Bottomley" , "Martin K. Petersen" , John Stultz , linux-scsi@vger.kernel.org Subject: [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps Date: Sun, 19 Jun 2016 17:27:18 -0700 Message-Id: <1466382443-11063-20-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 trace timestamps use struct timespec and CURRENT_TIME which are not y2038 safe. These timestamps are only part of the trace log on the machine and are not shared with the fnic. Replace then with y2038 safe struct timespec64 and ktime_get_real_ts64(), respectively. Note that change to add time64_to_tm() is already part of John's kernel tree: https://lkml.org/lkml/2016/6/17/875 . Signed-off-by: Deepa Dinamani Cc: Hiral Patel Cc: Suma Ramars Cc: Brian Uchino Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: John Stultz Cc: linux-scsi@vger.kernel.org --- drivers/scsi/fnic/fnic_trace.c | 4 ++-- drivers/scsi/fnic/fnic_trace.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c index 4e15c4b..5a5fa01 100644 --- a/drivers/scsi/fnic/fnic_trace.c +++ b/drivers/scsi/fnic/fnic_trace.c @@ -613,7 +613,7 @@ int fnic_fc_trace_set_data(u32 host_no, u8 frame_type, fc_trace_entries.rd_idx = 0; } - fc_buf->time_stamp = CURRENT_TIME; + ktime_get_real_ts64(&fc_buf->time_stamp); fc_buf->host_no = host_no; fc_buf->frame_type = frame_type; @@ -740,7 +740,7 @@ void copy_and_format_trace_data(struct fc_trace_hdr *tdata, len = *orig_len; - time_to_tm(tdata->time_stamp.tv_sec, 0, &tm); + time64_to_tm(tdata->time_stamp.tv_sec, 0, &tm); fmt = "%02d:%02d:%04ld %02d:%02d:%02d.%09lu ns%8x %c%8x\t"; len += snprintf(fnic_dbgfs_prt->buffer + len, diff --git a/drivers/scsi/fnic/fnic_trace.h b/drivers/scsi/fnic/fnic_trace.h index a8aa057..e375d0c 100644 --- a/drivers/scsi/fnic/fnic_trace.h +++ b/drivers/scsi/fnic/fnic_trace.h @@ -72,7 +72,7 @@ struct fnic_trace_data { typedef struct fnic_trace_data fnic_trace_data_t; struct fc_trace_hdr { - struct timespec time_stamp; + struct timespec64 time_stamp; u32 host_no; u8 frame_type; u8 frame_len;