[libmultipath] don't trust the path wwid from cache if pathinfo() fails
authorroot <root@xa-s05.(none)>
Mon, 26 Sep 2005 09:32:46 +0000 (11:32 +0200)
committerroot <root@xa-s05.(none)>
Mon, 26 Sep 2005 09:32:46 +0000 (11:32 +0200)
This kept the reduced map from loading when multipathd runs and a path
is failed or offline.

Also fix get_claimed() false positive returns by checking errno == EBUSY

libmultipath/discovery.c

index 449a253..3558b00 100644 (file)
@@ -225,7 +225,7 @@ get_claimed(char * devname)
 {
        int fd = opennode(devname, O_EXCL);
 
-       if (fd < 0)
+       if (fd <= 0 && errno == EBUSY)
                return 1;
 
        close(fd);
@@ -670,8 +670,9 @@ pathinfo (struct path *pp, vector hwtable, int mask)
 out:
        /*
         * Recoverable error, for example faulty or offline path
-        * Force path state to "failed"
+        * Set up safe defaults, don't trust the cache
         */
+       memset(pp->wwid, 0, WWID_SIZE);
        pp->state = PATH_DOWN;
        return 0;
 }