]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: 3w-9xxx: rework lock timeouts
authorArnd Bergmann <arnd@arndb.de>
Fri, 10 Nov 2017 15:58:27 +0000 (16:58 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Dec 2017 01:32:53 +0000 (20:32 -0500)
commit7eb28382b92a72a04093ac06c710f549107749b7
treeaccc9c2cca61f6f9b816a63d9b0e629a5b917add
parent94cf3df9514f0d4011f9def18d664a7970d91503
scsi: 3w-9xxx: rework lock timeouts

The TW_IOCTL_GET_LOCK ioctl uses do_gettimeofday() to check whether a
lock has expired. This can misbehave due to a concurrent settimeofday()
call, as it is based on 'real' time, and it will overflow in y2038 on
32-bit architectures, producing unexpected results when used across the
overflow time.

This changes it to using monotonic time, using ktime_get() to simplify
the code.

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-9xxx.h