]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
staging: lustre: use explicit poll loop in ptlrpc_service_unlink_rqbd
authorNeilBrown <neilb@suse.com>
Mon, 12 Feb 2018 23:47:59 +0000 (10:47 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 14:19:11 +0000 (15:19 +0100)
Rather an using l_wait_event(), use wait_event_idle_timeout()
with an explicit loop so it is easier to see what is happening.

Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ptlrpc/service.c

index 5c41297d23d20e3d1bedd648d5bcbc663d1c0706..6e340341743408c86b745f2534478121d08bea8c 100644 (file)
@@ -2618,7 +2618,7 @@ ptlrpc_service_unlink_rqbd(struct ptlrpc_service *svc)
 {
        struct ptlrpc_service_part *svcpt;
        struct ptlrpc_request_buffer_desc *rqbd;
-       struct l_wait_info lwi;
+       int cnt;
        int rc;
        int i;
 
@@ -2658,12 +2658,13 @@ ptlrpc_service_unlink_rqbd(struct ptlrpc_service *svc)
                         * the HUGE timeout lets us CWARN for visibility
                         * of sluggish LNDs
                         */
-                       lwi = LWI_TIMEOUT_INTERVAL(
-                                       LONG_UNLINK * HZ,
-                                       HZ, NULL, NULL);
-                       rc = l_wait_event(svcpt->scp_waitq,
-                                         svcpt->scp_nrqbds_posted == 0, &lwi);
-                       if (rc == -ETIMEDOUT) {
+                       cnt = 0;
+                       while (cnt < LONG_UNLINK &&
+                              (rc = wait_event_idle_timeout(svcpt->scp_waitq,
+                                                            svcpt->scp_nrqbds_posted == 0,
+                                                            HZ)) == 0)
+                               cnt ++;
+                       if (rc == 0) {
                                CWARN("Service %s waiting for request buffers\n",
                                      svcpt->scp_service->srv_name);
                        }