@@ -553,6 +553,21 @@
if (0 <= readattr(attr_path, attr_buff) && strlen(attr_buff) > 0)
strncpy(curpath->tgt_node_name, attr_buff,
strlen(attr_buff) - 1);
+ else {
+ if(safe_sprintf(attr_path,
+ "%s/class/iscsi_transport/target%i:%i:%i/target_name",
+ sysfs_path,
+ curpath->sg_id.host_no,
+ curpath->sg_id.channel,
+ curpath->sg_id.scsi_id)) {
+ condlog(0, "attr_path too small");
+ return 1;
+ }
+ if (0 <= readattr(attr_path, attr_buff) &&
+ strlen(attr_buff) > 0)
+ strncpy(curpath->tgt_node_name, attr_buff,
+ strlen(attr_buff) - 1);
+ }
condlog(3, "tgt_node_name = %s", curpath->tgt_node_name);
return 0;