Skip to contentSkip to conversation

multipath-tools/libmultipath discovery.c switc ...

PATCH [email protected] 1 participant 1 message Nov 30, 2010 Device mapper

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: multipath-tools
Branch: RHEL5_FC6
Changes by: [email protected] 2010-11-30 17:21:20

Modified files:
libmultipath : discovery.c switchgroup.c

Log message:
updated fix for bzs #484419 and #570513.
simplified cciss handling to mirror what upstream does. Simply assume that devices named like a cciss device are a cciss device.
Also, don't divide the priority by the number of enabled paths if that number is 0. Not applicable upstream.

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.16&r2=1.32.2.17
http://sourceware.org/cgi-bin/cvsweb.cgi/multipath-tools/libmultipath/switchgroup.c.diff?cvsroot=dm&only_with_tag=RHEL5_FC6&r1=1.5.2.3&r2=1.5.2.4

libmultipath/discovery.c +3 -23
@@ -477,24 +477,6 @@
 }
 
 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;
@@ -536,9 +518,8 @@
 
 	while (loop--) {
 		sdev = sysfs_open_device_path(attr_buff);
-		if(!strncmp(pp->dev,"cciss",5)) 
-                         sysfs_get_driver(sysfs_path, pp->dev,
-                             sdev->bus);
+		if(!strncmp(pp->dev,"cciss",5))
+			strcpy(sdev->bus, "cciss");
 
 		if (strlen(sdev->bus))
 			break;
@@ -549,8 +530,7 @@
 #else
 	sdev = sysfs_open_device_path(attr_buff);
 	if(!strncmp(pp->dev,"cciss",5))
-                  sysfs_get_driver(sysfs_path, pp->dev,
-                     sdev->bus);
+		strcpy(sdev->bus, "cciss");
 #endif
 
 	if (!strncmp(sdev->bus, "scsi", 4))
libmultipath/switchgroup.c +1 -1
@@ -36,7 +36,7 @@
 				enabled_paths++;
 			}
 		}
-		if (conf->pg_prio_calc == PG_PRIO_CALC_AVG)
+		if (conf->pg_prio_calc == PG_PRIO_CALC_AVG && enabled_paths)
 			pgp->priority = priority / enabled_paths;
 		else
 			pgp->priority = priority;