staging/lustre: use 64-bit times for ksnd_connd
authorArnd Bergmann <arnd@arndb.de>
Sun, 27 Sep 2015 20:45:21 +0000 (16:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 02:03:37 +0000 (04:03 +0200)
The connection starting/failing time stamps will overflow in 2038
on 32-bit machines, so we need to use time64_t and ktime_get_real_seconds()
instead.

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>
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c

index 22f4cd0173c1530ee529c6cb9ac2fb6afbe5c9b5..904d15837cbb8141429f9e128ce1ac8e1826d319 100644 (file)
@@ -2426,7 +2426,7 @@ ksocknal_base_startup(void)
 
        ksocknal_data.ksnd_connd_starting       = 0;
        ksocknal_data.ksnd_connd_failed_stamp   = 0;
-       ksocknal_data.ksnd_connd_starting_stamp = get_seconds();
+       ksocknal_data.ksnd_connd_starting_stamp = ktime_get_real_seconds();
        /* must have at least 2 connds to remain responsive to accepts while
         * connecting */
        if (*ksocknal_tunables.ksnd_nconnds < SOCKNAL_CONND_RESV + 1)
index a0fcbc39f86b918ba052329ff1073ef346e219af..b349847f9cf96418f355d9e1c3a6b04c7d9f5f6d 100644 (file)
@@ -216,13 +216,13 @@ typedef struct {
        wait_queue_head_t       ksnd_connd_waitq;       /* connds sleep here */
        int                     ksnd_connd_connecting;  /* # connds connecting
                                                         */
-       long                    ksnd_connd_failed_stamp;/* time stamp of the
+       time64_t                ksnd_connd_failed_stamp;/* time stamp of the
                                                         * last failed
                                                         * connecting attempt */
-       unsigned                ksnd_connd_starting;    /* # starting connd */
-       long                    ksnd_connd_starting_stamp;/* time stamp of the
+       time64_t                ksnd_connd_starting_stamp;/* time stamp of the
                                                           * last starting connd
                                                           */
+       unsigned                ksnd_connd_starting;    /* # starting connd */
        unsigned                ksnd_connd_running;     /* # running connd */
        spinlock_t              ksnd_connd_lock;        /* serialise */
 
index 6d87731c539dd62e86150c1e7ae6559a985e2b50..354c8105f9a01972343e78a8b7357245ee3db0e5 100644 (file)
@@ -1998,7 +1998,7 @@ ksocknal_connect (ksock_route_t *route)
  * running out of resource.
  */
 static int
-ksocknal_connd_check_start(long sec, long *timeout)
+ksocknal_connd_check_start(time64_t sec, long *timeout)
 {
        char name[16];
        int rc;
@@ -2048,7 +2048,7 @@ ksocknal_connd_check_start(long sec, long *timeout)
        /* we tried ... */
        LASSERT(ksocknal_data.ksnd_connd_starting > 0);
        ksocknal_data.ksnd_connd_starting--;
-       ksocknal_data.ksnd_connd_failed_stamp = get_seconds();
+       ksocknal_data.ksnd_connd_failed_stamp = ktime_get_real_seconds();
 
        return 1;
 }
@@ -2060,7 +2060,7 @@ ksocknal_connd_check_start(long sec, long *timeout)
  * again to recheck these conditions.
  */
 static int
-ksocknal_connd_check_stop(long sec, long *timeout)
+ksocknal_connd_check_stop(time64_t sec, long *timeout)
 {
        int val;
 
@@ -2141,7 +2141,7 @@ ksocknal_connd (void *arg)
 
        while (!ksocknal_data.ksnd_shuttingdown) {
                ksock_route_t *route = NULL;
-               long sec = get_seconds();
+               time64_t sec = ktime_get_real_seconds();
                long timeout = MAX_SCHEDULE_TIMEOUT;
                int dropped_lock = 0;