diff mbox series

[v3,23/24] multipathd: simplify retry logic in ev_add_path()

Message ID 20181210094959.11338-24-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: improve logging at -v3 | expand

Commit Message

Martin Wilck Dec. 10, 2018, 9:49 a.m. UTC
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 | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/multipathd/main.c b/multipathd/main.c
index fd3459f7..99145293 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -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);
 		/*