From patchwork Thu Jun 9 05:05:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9166263 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 63CC7607DA for ; Thu, 9 Jun 2016 05:10:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55E1A26E1A for ; Thu, 9 Jun 2016 05:10:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AC962830C; Thu, 9 Jun 2016 05:10:07 +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 B680A28294 for ; Thu, 9 Jun 2016 05:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946014AbcFIFHj (ORCPT ); Thu, 9 Jun 2016 01:07:39 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34226 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426569AbcFIFGF (ORCPT ); Thu, 9 Jun 2016 01:06:05 -0400 Received: by mail-pa0-f68.google.com with SMTP id ug1so1915835pab.1; Wed, 08 Jun 2016 22:06:04 -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=6ZL7yCm+lvQM4sMOOnzwJKNl9mJQ+EWLvV1QDWR3ySI=; b=q3zQqXnooNlUL/KsLn0YnOfMCibt7cuw4n6Ce38BruzN2nKjDhTuXopoN9sf41UnoK b9cdsrAdEMmBg4zdQD/JQ7yQWSuzgSPofkwJ0mgwkf1umt5F78hpZ1HaQIxDOKN8S+1Z gYlpgaRyw0UTfbSJ7+P44dKxITLrntIMQ04/J/VuZq1tdn/9s8X+xtsTuzfSxNgstvVC pIPSM+kZ4mf+wF7NfE+ReBKOjwpOiH54V8xvlvMzs8IQY46EGYPRswbXFUNEszAGLNkr 7YyBX/3jzAXd/JGQSVzoa9xhqL3fJcDnwv/Nl3K21+oDy13iTn62HIlfHUe5SRUVPqFH IRVw== 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=6ZL7yCm+lvQM4sMOOnzwJKNl9mJQ+EWLvV1QDWR3ySI=; b=Z/AqOKtkBZBPpmhTaemJXe76Ta2E7SmnYKnY+uiWBqd6NTwaDV2wrPr4Uk56NrXZaG hTafJiZuiztfnuZGfwpnjyT8fBY1brSGdqrdE1aiebsbrAwavYTPY33/1K9ec9fZIFMK Ow4UlHlYd1QbU9xZpWfWHEXdckK0Srpv1zxez8FdusUqMPAEfAtTzGC8YhGAMKDHO79E oJPNCMmDQFnb/kFy05UWgXwWaUrJsVdH+bWHzAM5Fnnf8SWDS9YQGQ7v2N9c32Ff1X6X +CXOFLaA6+4k0dQD7s0IhaYiL6wGOk7VVBodWozeyAwrP5wV49btOSmDbbHyAxfLWqkz urKg== X-Gm-Message-State: ALyK8tJxPOaiyGMVyFYbg6ur+xbhPoVWm0OmuMhTlqhAyWxQ91PdWb7uXS8f5rVcbzFyMQ== X-Received: by 10.66.126.11 with SMTP id mu11mr10172816pab.18.1465448759023; Wed, 08 Jun 2016 22:05:59 -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 129sm6220808pfe.3.2016.06.08.22.05.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 22:05:58 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Thomas Gleixner , Al Viro , Linus Torvalds , y2038@lists.linaro.org, Hiral Patel , Suma Ramars , Brian Uchino , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH 16/21] fnic: Use time64_t to represent trace timestamps Date: Wed, 8 Jun 2016 22:05:00 -0700 Message-Id: <1465448705-25055-17-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com> References: <1465448705-25055-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. Signed-off-by: Deepa Dinamani Cc: Hiral Patel Cc: Suma Ramars Cc: Brian Uchino Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" 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;