All of lore.kernel.org
 help / color / mirror / Atom feed
From: bmarzins@sourceware.org
To: dm-cvs@sourceware.org, dm-devel@redhat.com
Subject: multipath-tools/libmultipath discovery.c structs.h
Date: 10 Oct 2011 03:03:18 -0000	[thread overview]
Message-ID: <20111010030318.15102.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/dm
Module name:	multipath-tools
Branch: 	RHEL5_FC6
Changes by:	bmarzins@sourceware.org	2011-10-10 03:03:18

Modified files:
	libmultipath   : discovery.c structs.h 

Log message:
	Fix for bz #650759. tgt_node_name wasn't working for iscsi devices.  multipath
	now tries
	devices/platform/host<x>/session<y>/iscsi_session:session<y>/targetname
	
	if
	
	class/fc_transport/target<x>:<y>:<z>/node_name
	
	fails.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.32.2.21&r2=1.32.2.22
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/structs.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.18.2.9&r2=1.18.2.10

--- multipath-tools/libmultipath/discovery.c	2011/07/20 21:24:52	1.32.2.21
+++ multipath-tools/libmultipath/discovery.c	2011/10/10 03:03:17	1.32.2.22
@@ -733,15 +733,35 @@
 		condlog(0, "attr_path too small");
 		return 1;
 	}
-	if (!(attr = sysfs_open_attribute(attr_path)))
-		return 0;
-
-	if (sysfs_read_attribute(attr))
-		goto err;
-
+	if (!(attr = sysfs_open_attribute(attr_path)) ||
+	    sysfs_read_attribute(attr)) {
+		unsigned int checkhost, session;
+		if (attr)
+			goto err;
+		if (safe_sprintf(attr_path,
+				 "%s/devices/platform/host%%u/session%%u/",
+				 sysfs_path)) {
+			condlog(0, "attr_path too small");
+			return 1;
+		}
+		if (sscanf(attr_buff, attr_path, &checkhost, &session) != 2)
+			return 0;
+		if (checkhost != pp->sg_id.host_no)
+			return 0;
+		if (safe_sprintf(attr_path, "%s/devices/platform/host%u/session%u/iscsi_session:session%u/targetname", sysfs_path, checkhost, session, session)) {
+			condlog(0, "attr_path too small");
+			return 1;
+		}
+		if (!(attr = sysfs_open_attribute(attr_path)))
+			return 0;
+		if (sysfs_read_attribute(attr))
+			goto err;
+	}
 	if (attr->len > 0)
 		strncpy(pp->tgt_node_name, attr->value, attr->len - 1);
 
+	sysfs_close_attribute(attr);
+
 	condlog(3, "%s: tgt_node_name = %s",
 		pp->dev, pp->tgt_node_name);
 
--- multipath-tools/libmultipath/structs.h	2011/02/18 18:27:00	1.18.2.9
+++ multipath-tools/libmultipath/structs.h	2011/10/10 03:03:17	1.18.2.10
@@ -5,7 +5,7 @@
 
 #define WWID_SIZE		128
 #define SERIAL_SIZE		64
-#define NODE_NAME_SIZE		19
+#define NODE_NAME_SIZE		224
 #define PATH_STR_SIZE  		16
 #define PARAMS_SIZE		1024
 #define FILE_NAME_SIZE		256

             reply	other threads:[~2011-10-10  3:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10  3:03 bmarzins [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-05-28  4:53 multipath-tools/libmultipath discovery.c structs.h bmarzins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111010030318.15102.qmail@sourceware.org \
    --to=bmarzins@sourceware.org \
    --cc=dm-cvs@sourceware.org \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.