multipathd: simplify retry logic in ev_add_path()
authorMartin Wilck <mwilck@suse.com>
Mon, 10 Dec 2018 09:49:58 +0000 (10:49 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 10 Dec 2018 23:41:12 +0000 (00:41 +0100)
Move the retry loop for DOMAP_RETRY out of the redundant outer
if conditional, and replace the goto construct with a while loop.

Signed-off-by: Martin Wilck <mwilck@suse.com>
multipathd/main.c

index fd3459f..9914529 100644 (file)
@@ -993,15 +993,14 @@ rescan:
        /*
         * reload the map for the multipath mapped device
         */
-retry:
        ret = domap(mpp, params, 1);
+       while (ret == DOMAP_RETRY && retries-- > 0) {
+               condlog(0, "%s: retry domap for addition of new "
+                       "path %s", mpp->alias, pp->dev);
+               sleep(1);
+               ret = domap(mpp, params, 1);
+       }
        if (ret == DOMAP_FAIL || ret == DOMAP_RETRY) {
-               if (ret == DOMAP_RETRY && retries-- > 0) {
-                       condlog(0, "%s: retry domap for addition of new "
-                               "path %s", mpp->alias, pp->dev);
-                       sleep(1);
-                       goto retry;
-               }
                condlog(0, "%s: failed in domap for addition of new "
                        "path %s", mpp->alias, pp->dev);
                /*