Commit 95cd2644 authored by Hongchao Zhang's avatar Hongchao Zhang Committed by Oleg Drokin
Browse files

LU-13667 ptlrpc: fix endless loop issue

In ptlrpc_pinger_main, if the process to ping the recoverable
clients or obd_update_maxusage takes too long time, it could
be stuck in endless loop because of the negative value returned
by pinger_check_timeout.

Lustre-commit: 6be2dbb2

Change-Id: Ib7fc22b3cc31255223bc2be60224ced1a3585f87
Signed-off-by: default avatarHongchao Zhang <>
Reviewed-by: default avatarAndreas Dilger <>
Reviewed-by: default avatarOlaf Faaland-LLNL <>
Reviewed-by: default avatarOleg Drokin <>
Signed-off-by: default avatarMinh Diep <>

Tested-by: default avatarjenkins <>
Tested-by: default avatarMaloo <>
parent 7635e632
......@@ -268,13 +268,14 @@ static DECLARE_DELAYED_WORK(ping_work, ptlrpc_pinger_main);
static void ptlrpc_pinger_main(struct work_struct *ws)
time64_t this_ping = ktime_get_seconds();
time64_t time_to_next_wake;
time64_t this_ping, time_after_ping, time_to_next_wake;
struct timeout_item *item;
struct obd_import *imp;
struct list_head *iter;
do {
this_ping = ktime_get_seconds();
list_for_each_entry(item, &timeout_list, ti_chain)
item->ti_cb(item, item->ti_cb_data);
......@@ -290,9 +291,15 @@ static void ptlrpc_pinger_main(struct work_struct *ws)
ptlrpc_update_next_ping(imp, 0);
time_after_ping = ktime_get_seconds();
/* update memory usage info */
if ((ktime_get_seconds() - this_ping - 3) > PING_INTERVAL)
CDEBUG(D_HA, "long time to ping: %lld, %lld, %lld\n",
this_ping, time_after_ping, ktime_get_seconds());
/* Wait until the next ping time, or until we're stopped. */
time_to_next_wake = pinger_check_timeout(this_ping);
/* The ping sent by ptlrpc_send_rpc may get sent out
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment