From patchwork Sat Aug 13 22:48:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9278695 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 349A560780 for ; Sun, 14 Aug 2016 10:22:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2585E28996 for ; Sun, 14 Aug 2016 10:22:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18B10289AD; Sun, 14 Aug 2016 10:22:18 +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=unavailable 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 C474428996 for ; Sun, 14 Aug 2016 10:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753132AbcHNKWD (ORCPT ); Sun, 14 Aug 2016 06:22:03 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:34688 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753125AbcHNKWC (ORCPT ); Sun, 14 Aug 2016 06:22:02 -0400 Received: by mail-pa0-f65.google.com with SMTP id hh10so2021806pac.1; Sun, 14 Aug 2016 03:22:02 -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=Is3NpUF0tAehrCr8Gh+nPW+0bKNYWmxRsffBgZRPkL8=; b=Qd/4zuB4KX92MAjq6aGIEjQOWVFkC62JyemL0ffjq59DHpWvpDLsitvI6ogI9LBx+A YitcugBJOcLQz1TtMdt0xnt2iUSfY1InpMuzCs1ZAb8F6KSF+PvWcmCkIa4GgW44dYan sbVb82Aj3L8+Z9JvrwyHpS/1+yYN5b6hI66QENgZ2ljwDF5h8JyfGx8xn9tD1XS3+nvh TSWoQt/qK7xri/8nrtPL0ks69o5xLZOdE1aQxyQLmpZNGk/UI1Wi4SzeKuf7Ke34SP2G i0hf8HMk5/NpkHKw17LCm6AGw2+eYIvIY+0NwlKPCIpbrwju0DUlXhIkeM/8nI2Q2mn7 zJDg== 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=Is3NpUF0tAehrCr8Gh+nPW+0bKNYWmxRsffBgZRPkL8=; b=UT3sP/Fg/6U9T3nVlTUsgZMFgr/rOTosRYTyIGdCaV68MzquF/CQmskH+OQAp5EnMk 2sDfHre5VQV5sRcHfu1vCTWyg7wRbSbqw2PG2CmeKvDsn60MZw/gigI0ZkNUahHs9XjW EwTgdJmbLwd9ySSPwyM8uF6tlG4AIXqZqYLUoNeY6CO9ihIZIDEdY23+5YL8jczighFC uddLoWR/KzdJhycnfqrGmkRoLVUM2NIBLOzYOt7mLsyc6kIJB4c8Zhfcjlnv6xSp5/Em yl9TkhPZgfmcXWUSJWq6nDQMZN/gE5RxiqA0WqUlflaWUG3baoFsu/bY+GWbqPlrY4sb 8psg== X-Gm-Message-State: AEkooutyeUb4PoZl+8i6wXvC9/VWzCE1oCj9ctB6RcmOEbBzYla9IrWQNMLDh78BYuYaZg== X-Received: by 10.66.181.16 with SMTP id ds16mr40170016pac.102.1471128583342; Sat, 13 Aug 2016 15:49:43 -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 81sm22528007pfm.90.2016.08.13.15.49.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Aug 2016 15:49:42 -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" , linux-scsi@vger.kernel.org Subject: [PATCH v4 24/26] fnic: Use time64_t to represent trace timestamps Date: Sat, 13 Aug 2016 15:48:36 -0700 Message-Id: <1471128518-24075-25-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471128518-24075-1-git-send-email-deepa.kernel@gmail.com> References: <1471128518-24075-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 Reviewed-by: Arnd Bergmann 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;