Whamcloud - gitweb
LU-13276 lnet: Update nnis to avoid infinite loop 76/37676/2
authorChris Horn <hornc@cray.com>
Thu, 20 Feb 2020 23:38:11 +0000 (17:38 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 5 Mar 2020 22:36:59 +0000 (22:36 +0000)
The goto loop in lnet_push_target_resize() is infinite because
the loop variable 'nnis' is not updated with the new value from
ln_push_target_nnis.

Cray-bug-id: LUS-8526
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I65b0bc0b56393f2296bafa3a964c59840baa0643
Reviewed-on: https://review.whamcloud.com/37676
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/api-ni.c

index 9105eb1..f8310e4 100644 (file)
@@ -1854,14 +1854,16 @@ int lnet_push_target_resize(void)
        struct lnet_handle_md old_mdh;
        struct lnet_ping_buffer *pbuf;
        struct lnet_ping_buffer *old_pbuf;
-       int nnis = the_lnet.ln_push_target_nnis;
+       int nnis;
        int rc;
 
+again:
+       nnis = the_lnet.ln_push_target_nnis;
        if (nnis <= 0) {
                rc = -EINVAL;
                goto fail_return;
        }
-again:
+
        pbuf = lnet_ping_buffer_alloc(nnis, GFP_NOFS);
        if (!pbuf) {
                rc = -ENOMEM;