summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extras/multipath/ChangeLog1
-rw-r--r--extras/multipath/main.c6
-rw-r--r--extras/multipath/multipath.hotplug3
3 files changed, 9 insertions, 1 deletions
diff --git a/extras/multipath/ChangeLog b/extras/multipath/ChangeLog
index 9296b4db68..a780865d3e 100644
--- a/extras/multipath/ChangeLog
+++ b/extras/multipath/ChangeLog
@@ -1,4 +1,5 @@
2003-12-29 multipath-012
+ * check hotplug event refers to a block device; if not exit early
* refresh doc
* add the uninstall target in Makefile
2003-12-22 multipath-010
diff --git a/extras/multipath/main.c b/extras/multipath/main.c
index f62e0f9954..a8e29e8ba6 100644
--- a/extras/multipath/main.c
+++ b/extras/multipath/main.c
@@ -261,7 +261,11 @@ get_all_paths_sysfs(struct env * conf, struct path * all_paths)
sprintf(buff, "%s%s/block",
conf->sysfs_path, conf->hotplugdev);
memset(conf->hotplugdev, 0, FILE_NAME_SIZE);
- readlink(buff, conf->hotplugdev, FILE_NAME_SIZE);
+
+ /* if called from hotplug but with no block, leave */
+ if (0 > readlink(buff, conf->hotplugdev, FILE_NAME_SIZE))
+ return 0;
+
basename(conf->hotplugdev, buff);
sprintf(curpath.sg_dev, "/dev/%s", buff);
diff --git a/extras/multipath/multipath.hotplug b/extras/multipath/multipath.hotplug
index 8d60f4d2c6..9bab619826 100644
--- a/extras/multipath/multipath.hotplug
+++ b/extras/multipath/multipath.hotplug
@@ -1,3 +1,6 @@
. /etc/hotplug/hotplug.functions
+
+# wait for sysfs
sleep 1
+
mesg `/sbin/multipath scsi $DEVPATH`