Re: [Y2038] [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps

2016-06-22 Thread Deepa Dinamani
On Wed, Jun 22, 2016 at 7:09 AM, Arnd Bergmann  wrote:
> On Sunday, June 19, 2016 5:27:18 PM CEST 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.
>>
>> Note that change to add time64_to_tm() is already part of John's
>> kernel tree: https://lkml.org/lkml/2016/6/17/875 .
>>
>
> While the patch looks good, I think it can't be part of this
> series now, since it has to go on top of that first patch,
> rather than merged in parallel.

Oh, I didn't realize we could merge these in parallel.
I thought the time64_to_tm() had to go in first.

> When you send a pull request, please leave it out and submit
> this one separately after 4.8-rc1.

Will do.

Thanks,
Deepa
___
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038


Re: [Y2038] [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps

2016-06-22 Thread Arnd Bergmann
On Sunday, June 19, 2016 5:27:18 PM CEST 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.
> 
> Note that change to add time64_to_tm() is already part of John's
> kernel tree: https://lkml.org/lkml/2016/6/17/875 .
> 

While the patch looks good, I think it can't be part of this
series now, since it has to go on top of that first patch,
rather than merged in parallel.

When you send a pull request, please leave it out and submit
this one separately after 4.8-rc1.

Arnd

___
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038


[Y2038] [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps

2016-06-19 Thread Deepa Dinamani
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-s...@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(_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, );
+   time64_to_tm(tdata->time_stamp.tv_sec, 0, );
 
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;
-- 
1.9.1

___
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038