libmultipath: unset 'uid_attribute' on failure
authorHannes Reinecke <hare@suse.de>
Thu, 11 Dec 2014 15:15:41 +0000 (16:15 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 29 Mar 2015 16:22:37 +0000 (18:22 +0200)
Due to a race condition within udev the 'uid_attribute'
might not always be set. So we should be zeroing the
'uid_attribute' when retrieving the uid by other means,
otherwise the discovery process will blacklist the device.

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

index d5dda2c..8e6b228 100644 (file)
@@ -1497,13 +1497,17 @@ get_uid (struct path * pp)
                }
                if (len <= 0) {
                        len = get_vpd_uid(pp);
-                       if (len > 0)
+                       if (len > 0) {
                                origin = "sysfs";
+                               pp->uid_attribute = NULL;
+                       }
                }
                if (len <= 0) {
                        len = get_udev_uid(pp, DEFAULT_UID_ATTRIBUTE);
-                       if (len > 0)
-                               origin = "udev";
+                       if (len > 0) {
+                               origin = "default";
+                               pp->uid_attribute = DEFAULT_UID_ATTRIBUTE;
+                       }
                }
        }
        if ( len < 0 ) {