From: bmarzins@sourceware.org
To: dm-cvs@sourceware.org, dm-devel@redhat.com
Subject: multipath-tools ./multipath.conf.defaults libm ...
Date: 3 Sep 2010 03:46:13 -0000 [thread overview]
Message-ID: <20100903034613.9341.qmail@sourceware.org> (raw)
CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: bmarzins@sourceware.org 2010-09-03 03:46:12
Modified files:
. : multipath.conf.defaults
libmultipath : discovery.c discovery.h hwtable.c
Log message:
Fix for bz #484419. Now that the RHEL5 kernel exports everything necessary
to sysfs, get all the cciss specific sysfs pathinfo correctly.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/multipath.conf.defaults.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.4.23&r2=1.5.4.24
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.32.2.15&r2=1.32.2.16
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/discovery.h.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.14.2.4&r2=1.14.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/hwtable.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.20.2.30&r2=1.20.2.31
--- multipath-tools/multipath.conf.defaults 2010/08/24 21:51:10 1.5.4.23
+++ multipath-tools/multipath.conf.defaults 2010/09/03 03:46:11 1.5.4.24
@@ -150,6 +150,19 @@
# path_checker tur
# }
# device {
+# vendor "HP"
+# product "LOGICAL VOLUME.*"
+# getuid_callout "/sbin/cciss_id /dev/%n"
+# features "0"
+# hardware_handler "0"
+# path_grouping_policy multibus
+# failback immediate
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker cciss_tur
+# }
+# device {
# vendor "DDN"
# product "SAN DataDirector"
# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
--- multipath-tools/libmultipath/discovery.c 2010/08/11 23:05:50 1.32.2.15
+++ multipath-tools/libmultipath/discovery.c 2010/09/03 03:46:12 1.32.2.16
@@ -250,8 +250,10 @@
declare_sysfs_get_str(model, "%s/block/%s/device/model", 1);
declare_sysfs_get_str(rev, "%s/block/%s/device/rev", 1);
declare_sysfs_get_str(dev, "%s/block/%s/dev", 1);
-declare_sysfs_get_str(bustype, "%s/block/%s/device/bus", 1);
declare_sysfs_get_str(state, "%s/block/%s/device/state", 0);
+declare_sysfs_get_str(cciss_vendor, "%s/block/%s/vendor", 1);
+declare_sysfs_get_str(cciss_model, "%s/block/%s/model", 1);
+declare_sysfs_get_str(cciss_rev, "%s/block/%s/rev", 1);
int
sysfs_get_timeout (char * sysfs_path, char * dev, unsigned int *timeout)
@@ -475,6 +477,24 @@
}
static int
+sysfs_get_driver (char *sysfs_path, char * dev, char *driver)
+{
+ char path[FILE_NAME_SIZE];
+ char buff[SYSFS_NAME_LEN];
+
+ if (safe_sprintf(path, "%s/block/%s/device/driver", sysfs_path, dev)) {
+ condlog(0, "driver path too small");
+ return 1;
+ }
+ if (sysfs_get_link(path, buff, SYSFS_NAME_LEN) < 0) {
+ condlog(0, "can't get driver link: %s", strerror(errno));
+ return 1;
+ }
+ basename(buff, driver);
+ return 0;
+}
+
+static int
sysfs_get_bus (char * sysfs_path, struct path * pp)
{
struct sysfs_device *sdev;
@@ -517,8 +537,8 @@
while (loop--) {
sdev = sysfs_open_device_path(attr_buff);
if(!strncmp(pp->dev,"cciss",5))
- sysfs_get_bustype(sysfs_path,pp->dev,
- sdev->bus,5);
+ sysfs_get_driver(sysfs_path, pp->dev,
+ sdev->bus);
if (strlen(sdev->bus))
break;
@@ -529,8 +549,8 @@
#else
sdev = sysfs_open_device_path(attr_buff);
if(!strncmp(pp->dev,"cciss",5))
- sysfs_get_bustype(sysfs_path, pp->dev,
- sdev->bus,5);
+ sysfs_get_driver(sysfs_path, pp->dev,
+ sdev->bus);
#endif
if (!strncmp(sdev->bus, "scsi", 4))
@@ -692,20 +712,33 @@
static int
cciss_sysfs_pathinfo (struct path * curpath)
{
+ unsigned int controller, lun;
+ char dev_path[FILE_NAME_SIZE];
+
+ if (sscanf(curpath->dev, "cciss!c%ud%u", &controller, &lun) != 2) {
+ condlog(0, "invalid cciss device name : '%s'", curpath->dev);
+ return 1;
+ }
+
+ if(safe_sprintf(dev_path, "%s/device/cciss%u/c%ud%u", curpath->dev,
+ controller, controller, lun)) {
+ condlog(0, "dev_path too small");
+ return 1;
+ }
- if (sysfs_get_vendor(sysfs_path, curpath->dev,
+ if (sysfs_get_cciss_vendor(sysfs_path, dev_path,
curpath->vendor_id, SCSI_VENDOR_SIZE))
return 1;
condlog(3, "vendor = %s", curpath->vendor_id);
- if (sysfs_get_model(sysfs_path, curpath->dev,
+ if (sysfs_get_cciss_model(sysfs_path, dev_path,
curpath->product_id, SCSI_PRODUCT_SIZE))
return 1;
condlog(3, "product = %s", curpath->product_id);
- if (sysfs_get_rev(sysfs_path, curpath->dev,
+ if (sysfs_get_cciss_rev(sysfs_path, dev_path,
curpath->rev, SCSI_REV_SIZE))
return 1;
--- multipath-tools/libmultipath/discovery.h 2010/06/23 16:28:07 1.14.2.4
+++ multipath-tools/libmultipath/discovery.h 2010/09/03 03:46:12 1.14.2.5
@@ -30,7 +30,6 @@
int sysfs_get_model (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_rev (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_dev (char * sysfs_path, char * dev, char * buff, int len);
-int sysfs_get_bustype (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_state (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_size (char * sysfs_path, char * dev, unsigned long long *);
int sysfs_get_timeout (char * sysfs_path, char * dev, unsigned int *timeout);
--- multipath-tools/libmultipath/hwtable.c 2010/08/24 21:51:10 1.20.2.30
+++ multipath-tools/libmultipath/hwtable.c 2010/09/03 03:46:12 1.20.2.31
@@ -185,6 +185,22 @@
.minio = DEFAULT_MINIO,
.checker_name = READSECTOR0,
},
+ {
+ /* HP Smart Array */
+ .vendor = "HP",
+ .product = "LOGICAL VOLUME.*",
+ .getuid = "/sbin/cciss_id /dev/%n",
+ .getprio = NULL,
+ .features = DEFAULT_FEATURES,
+ .hwhandler = DEFAULT_HWHANDLER,
+ .selector = DEFAULT_SELECTOR,
+ .pgpolicy = MULTIBUS,
+ .pgfailback = FAILBACK_UNDEF,
+ .rr_weight = RR_WEIGHT_NONE,
+ .no_path_retry = 12,
+ .minio = DEFAULT_MINIO,
+ .checker_name = CCISS_TUR,
+ },
/*
* DDN controller family
*
next reply other threads:[~2010-09-03 3:46 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-03 3:46 bmarzins [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-06-14 21:56 multipath-tools ./multipath.conf.defaults libm bmarzins
2011-01-21 16:57 bmarzins
2010-11-12 20:17 bmarzins
2010-09-21 18:06 bmarzins
2010-09-14 19:42 bmarzins
2010-08-24 21:51 bmarzins
2010-08-09 21:35 bmarzins
2010-08-09 18:38 bmarzins
2010-02-10 4:11 bmarzins
2010-01-26 5:50 bmarzins
2009-12-02 19:15 bmarzins
2009-09-28 18:41 bmarzins
2009-09-28 18:28 bmarzins
2009-09-11 15:19 bmarzins
2009-08-19 21:52 bmarzins
2009-01-15 22:47 bmarzins
2009-01-13 22:26 bmarzins
2008-08-29 18:30 bmarzins
2008-07-12 17:36 bmarzins
2008-07-12 2:44 bmarzins
2008-07-12 0:07 bmarzins
2008-01-03 20:16 bmarzins
2007-10-09 21:48 bmarzins
2007-09-11 18:06 bmarzins
2007-08-14 18:08 bmarzins
2007-08-14 18:23 ` S. J. van Harmelen
2007-05-07 17:59 bmarzins
2006-12-19 22:51 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=20100903034613.9341.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).