Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1494515 > unrolled thread

[PATCH] fnic: Use time64_t to represent trace timestamps

Started byDeepa Dinamani <deepa.kernel@gmail.com>
First post2016-10-02 01:50 +0200
Last post2016-10-11 22:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] fnic: Use time64_t to represent trace timestamps Deepa Dinamani <deepa.kernel@gmail.com> - 2016-10-02 01:50 +0200
    Re: [PATCH] fnic: Use time64_t to represent trace timestamps Johannes Thumshirn <jthumshirn@suse.de> - 2016-10-04 10:00 +0200
    Re: [PATCH] fnic: Use time64_t to represent trace timestamps "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-10-11 22:30 +0200

#1494515 — [PATCH] fnic: Use time64_t to represent trace timestamps

FromDeepa Dinamani <deepa.kernel@gmail.com>
Date2016-10-02 01:50 +0200
Subject[PATCH] fnic: Use time64_t to represent trace timestamps
Message-ID<snCcx-78R-27@gated-at.bofh.it>
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 <deepa.kernel@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Cc: Hiral Patel <hiralpat@cisco.com>
Cc: Suma Ramars <sramars@cisco.com>
Cc: Brian Uchino <buchino@cisco.com>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
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;
-- 
2.7.4

[toc] | [next] | [standalone]


#1495249

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2016-10-04 10:00 +0200
Message-ID<sosNP-87P-23@gated-at.bofh.it>
In reply to#1494515
On Sat, Oct 01, 2016 at 04:48:14PM -0700, Deepa Dinamani wrote:
> 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 <deepa.kernel@gmail.com>
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Hiral Patel <hiralpat@cisco.com>
> Cc: Suma Ramars <sramars@cisco.com>
> Cc: Brian Uchino <buchino@cisco.com>
> Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> Cc: linux-scsi@vger.kernel.org
> ---

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [next] | [standalone]


#1499187

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-10-11 22:30 +0200
Message-ID<srbQt-2QB-3@gated-at.bofh.it>
In reply to#1494515
>>>>> "Deepa" == Deepa Dinamani <deepa.kernel@gmail.com> writes:

Deepa> trace timestamps use struct timespec and CURRENT_TIME which are
Deepa> not y2038 safe.  These timestamps are only part of the trace log
Deepa> on the machine and are not shared with the fnic.  Replace then
Deepa> with y2038 safe struct timespec64 and ktime_get_real_ts64(),
Deepa> respectively.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web