Always synchronize with dm state
authorHannes Reinecke <hare@suse.de>
Thu, 2 Jul 2009 12:53:53 +0000 (14:53 +0200)
committerHannes Reinecke <hare@suse.de>
Wed, 18 May 2011 08:28:14 +0000 (10:28 +0200)
When running on iSCSI the connection might suffer intermediate
errors, causing the path to fail. But by the time the path checker
runs these errors will be cleared by the iSCSI internal connection
recovery, which means the daemon will never see any error and not
reinstated any failed paths.

References: bnc#447887

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd/main.c

index dd779d0..7659bb2 100644 (file)
@@ -1028,6 +1028,14 @@ check_path (struct vectors * vecs, struct path * pp)
                pp->tick = 1;
                return;
        }
+       /*
+        * Synchronize with kernel state
+        */
+       if (update_multipath_strings(pp->mpp, vecs->pathvec)) {
+               condlog(1, "%s: Could not synchronize with kernel state\n",
+                       pp->dev);
+               pp->dmstate = PSTATE_UNDEF;
+       }
        if (newstate != pp->state) {
                int oldstate = pp->state;
                pp->state = newstate;
@@ -1039,8 +1047,7 @@ check_path (struct vectors * vecs, struct path * pp)
                 */
                pp->checkint = conf->checkint;
 
-               if (newstate == PATH_DOWN || newstate == PATH_SHAKY ||
-                   update_multipath_strings(pp->mpp, vecs->pathvec)) {
+               if (newstate == PATH_DOWN || newstate == PATH_SHAKY) {
                        /*
                         * proactively fail path in the DM
                         */