Ignore devices when sysfs_get_tgt_nodename fails
authorHannes Reinecke <hare@suse.de>
Wed, 3 Sep 2014 12:16:43 +0000 (14:16 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 29 Mar 2015 16:16:28 +0000 (18:16 +0200)
If sysfs_get_tgt_nodename fails we should not try to use this
device.

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

index b1db00f..a9962d1 100644 (file)
@@ -349,8 +349,9 @@ sysfs_get_tgt_nodename (struct path *pp, char * node)
                snprintf(node, NODE_NAME_SIZE, "ata-%d.00", tgtid);
                return 0;
        }
+       /* Unknown SCSI transport. Keep fingers crossed */
        pp->sg_id.proto_id = SCSI_PROTOCOL_UNSPEC;
-       return 1;
+       return 0;
 }
 
 int sysfs_get_host_adapter_name(struct path *pp, char *adapter_name)
@@ -807,10 +808,11 @@ scsi_sysfs_pathinfo (struct path * pp)
        /*
         * target node name
         */
-       if(!sysfs_get_tgt_nodename(pp, pp->tgt_node_name)) {
-               condlog(3, "%s: tgt_node_name = %s",
-                       pp->dev, pp->tgt_node_name);
-       }
+       if(sysfs_get_tgt_nodename(pp, pp->tgt_node_name))
+               return 1;
+
+       condlog(3, "%s: tgt_node_name = %s",
+               pp->dev, pp->tgt_node_name);
 
        return 0;
 }