[libmultipath] reset the multipath struct "action" field after usage
authorChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 9 Jan 2008 00:14:37 +0000 (01:14 +0100)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 9 Jan 2008 00:14:37 +0000 (01:14 +0100)
This is necessary for the daemon is stateful, and it will remember
this action value forever.

One example of a thing gone wrong is when daemon takes actions upon startup.
"show topo" will then always display these initial actions, though they are
long done.

libmultipath/configure.c

index 4a1966c..3b58af7 100644 (file)
@@ -365,7 +365,7 @@ domap (struct multipath * mpp)
 
        if (r) {
                /*
-                * DM_DEVICE_CREATE, DM_DEIVCE_RENAME, or DM_DEVICE_RELOAD
+                * DM_DEVICE_CREATE, DM_DEVICE_RENAME, or DM_DEVICE_RELOAD
                 * succeeded
                 */
 #ifndef DAEMON
@@ -376,6 +376,10 @@ domap (struct multipath * mpp)
                mpp->stat_map_loads++;
                condlog(2, "%s: load table [0 %llu %s %s]", mpp->alias,
                         mpp->size, DEFAULT_TARGET, mpp->params);
+               /*
+                * Required action is over, reset for the stateful daemon
+                */
+               mpp->action = ACT_NOTHING;
 #endif
                return DOMAP_OK;
        }