[PATCH 18/37] staging/lustre: use 64-bit time for obd eviction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The obd_eviction_timer will overflow in 2038 on 32-bit systems,
so replace it with a 64-bit time and ktime_get_real_seconds().

Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
 drivers/staging/lustre/lustre/include/obd.h    | 2 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index 0dbac3f53f01..f09a0405ff97 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -841,7 +841,7 @@ struct obd_device {
 	struct obd_export       *obd_self_export;
 	/* list of exports in LRU order, for ping evictor, with obd_dev_lock */
 	struct list_head	      obd_exports_timed;
-	time_t		  obd_eviction_timer; /* for ping evictor */
+	time64_t		  obd_eviction_timer; /* for ping evictor */
 
 	int			      obd_max_recoverable_clients;
 	atomic_t		     obd_connected_clients;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c
index 40de622450ee..c7c6cff80450 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -1085,13 +1085,13 @@ static void ptlrpc_update_export_timer(struct obd_export *exp, long extra_delay)
 			 * other PING_INTERVAL (see note in ptlrpc_pinger_main),
 			 * we better wait for 3. */
 			exp->exp_obd->obd_eviction_timer =
-				get_seconds() + 3 * PING_INTERVAL;
+				ktime_get_real_seconds() + 3 * PING_INTERVAL;
 			CDEBUG(D_HA, "%s: Think about evicting %s from "CFS_TIME_T"\n",
 			       exp->exp_obd->obd_name,
 			       obd_export_nid2str(oldest_exp), oldest_time);
 		}
 	} else {
-		if (get_seconds() >
+		if (ktime_get_real_seconds() >
 		    (exp->exp_obd->obd_eviction_timer + extra_delay)) {
 			/* The evictor won't evict anyone who we've heard from
 			 * recently, so we don't have to check before we start
-- 
2.1.0.rc2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux