From 7867f9a3fa04411117365558badd43b8cd5f1009 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Thu, 9 Mar 2017 13:06:29 -0500 Subject: [PATCH] LU-9019 socklnd: use 64-bit incarnation time stamp ksnn_incarnation is a 64-bit value, but using timeval to compute it will cause an overflow in 2038. This changes it to use ktime_get_real_ns() instead. Change-Id: I9a0b1f2c35d04d8dc2c8fd5e17e19583c8af5ff0 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/25690 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Doug Oucharek Reviewed-by: Olaf Weber Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- lnet/klnds/socklnd/socklnd.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/lnet/klnds/socklnd/socklnd.c b/lnet/klnds/socklnd/socklnd.c index 2b8854c..99f9781 100644 --- a/lnet/klnds/socklnd/socklnd.c +++ b/lnet/klnds/socklnd/socklnd.c @@ -2348,20 +2348,6 @@ ksocknal_base_shutdown(void) module_put(THIS_MODULE); } -static __u64 ksocknal_new_incarnation(void) -{ - struct timeval tv; - - /* The incarnation number is the time this module loaded and it - * identifies this particular instance of the socknal. Hopefully - * we won't be able to reboot more frequently than 1MHz for the - * forseeable future :) */ - - do_gettimeofday(&tv); - - return (((__u64)tv.tv_sec) * 1000000) + tv.tv_usec; -} - static int ksocknal_base_startup(void) { @@ -2794,8 +2780,8 @@ ksocknal_startup(struct lnet_ni *ni) goto fail_0; spin_lock_init(&net->ksnn_lock); - net->ksnn_incarnation = ksocknal_new_incarnation(); - ni->ni_data = net; + net->ksnn_incarnation = ktime_get_real_ns(); + ni->ni_data = net; if (!ni->ni_net->net_tunables_set) { ni->ni_net->net_tunables.lct_peer_timeout = *ksocknal_tunables.ksnd_peertimeout; -- 1.8.3.1