OSDN Git Service

scsi: 3ware: fix 32-bit time calculations
authorArnd Bergmann <arnd@arndb.de>
Fri, 10 Nov 2017 15:58:25 +0000 (16:58 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Dec 2017 01:32:53 +0000 (20:32 -0500)
commit9c88673f9d855899d640473a411a17f25eff45d8
treeac7acd56dcabd3d6e4cda1f5b502e2e476659e54
parent923282532beae96c2b9749bff0b3de33f1b12052
scsi: 3ware: fix 32-bit time calculations

twl_aen_queue_event/twa_aen_queue_event, we use do_gettimeofday() to
read the lower 32 bits of the current time in seconds, to pass them to
the TW_IOCTL_GET_NEXT_EVENT ioctl or the 3ware_aen_read sysfs file.

This will overflow on all architectures in year 2106, there is not much
we can do about that without breaking the ABI. User space has 90 years
to learn to deal with it, so it's probably ok.

I'm changing it to use ktime_get_real_seconds() with a comment to
document what happens when.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Adam Radford <aradford@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-sas.c