Whamcloud - gitweb
LU-15086 ptlrpc: fix timeout after spurious wakeup 08/45308/5
authorAlex Zhuravlev <bzzz@whamcloud.com>
Wed, 20 Oct 2021 11:10:57 +0000 (14:10 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 20 Nov 2021 06:26:30 +0000 (06:26 +0000)
so that final timeout don't exceed requested one

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Iff5e08c589cbbc3c483915002f3f9df7a6f2678a
Reviewed-on: https://review.whamcloud.com/45308
Reviewed-by: Andriy Skulysh <andriy.skulysh@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/ptlrpcd.c

index 4c9b577..1f540af 100644 (file)
@@ -480,7 +480,7 @@ static int ptlrpcd(void *arg)
                DEFINE_WAIT_FUNC(wait, woken_wake_function);
                time64_t timeout;
 
-               timeout = ptlrpc_set_next_timeout(set);
+               timeout = cfs_time_seconds(ptlrpc_set_next_timeout(set));
 
                lu_context_enter(&env.le_ctx);
                lu_context_enter(env.le_ses);
@@ -492,9 +492,11 @@ static int ptlrpcd(void *arg)
                        if (timeout == 0)
                                ret = wait_woken(&wait, TASK_IDLE,
                                                 MAX_SCHEDULE_TIMEOUT);
-                       else
-                               ret = wait_woken(&wait, TASK_IDLE,
-                                                cfs_time_seconds(timeout));
+                       else {
+                               ret = wait_woken(&wait, TASK_IDLE, timeout);
+                               if (ret > 0)
+                                       timeout = ret;
+                       }
                        if (ret != 0)
                                continue;
                        /* Timed out */