diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-09-27 16:45:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-29 04:03:35 +0200 |
commit | 5e50efea6a4fe6c92dce3022878f91cf17bdceb8 (patch) | |
tree | 28121e73c52705221d2678dddf100f69911f31c4 /drivers/staging/lustre/lnet | |
parent | a11ef8ca94cccca98e0d7f23d5145cad71dd62f0 (diff) |
staging/lustre: use 64-bit time LNetCtl()
This ioctl function passes a 64-bit time argument but then performs
a computation with a 32-bit get_seconds() value.
In order to avoid overflow here, this changes the code to use
64-bit math and ktime_get_real_seconds().
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet')
-rw-r--r-- | drivers/staging/lustre/lnet/lnet/api-ni.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 7fab03bee1ea..c368cf561b9d 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1343,6 +1343,7 @@ LNetCtl(unsigned int cmd, void *arg) lnet_process_id_t id = {0}; lnet_ni_t *ni; int rc; + unsigned long secs_passed; LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); @@ -1370,10 +1371,9 @@ LNetCtl(unsigned int cmd, void *arg) &data->ioc_nid, &data->ioc_flags, &data->ioc_priority); case IOC_LIBCFS_NOTIFY_ROUTER: + secs_passed = (ktime_get_real_seconds() - data->ioc_u64[0]); return lnet_notify(NULL, data->ioc_nid, data->ioc_flags, - cfs_time_current() - - cfs_time_seconds(get_seconds() - - (time_t)data->ioc_u64[0])); + jiffies - secs_passed * HZ); case IOC_LIBCFS_PORTALS_COMPATIBILITY: /* This can be removed once lustre stops calling it */ |