diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2008-12-11 16:03:28 -0600 |
---|---|---|
committer | Christophe Varoqui <christophe.varoqui@free.fr> | 2008-12-11 23:46:09 +0100 |
commit | 7fa7affc3d23dd9dc906804d22a61144bca9f9b9 (patch) | |
tree | 0d571beca6e1311d9cc808b974926ddfcbba841c /multipathd | |
parent | c8ea021ee4f5adc659d9595f67edc7a4e13683d2 (diff) | |
download | multipath-tools-7fa7affc3d23dd9dc906804d22a61144bca9f9b9.tar.gz multipath-tools-7fa7affc3d23dd9dc906804d22a61144bca9f9b9.tar.bz2 multipath-tools-7fa7affc3d23dd9dc906804d22a61144bca9f9b9.zip |
Fix for uevent devpath handling
This is necessary to make uevents work on fedora, since devpath appears as
something like:
'/devices/pci0000:00/0000:00:0a.0/0000:06:00.0/host11/rport-11:0-1/target11:0:1/11:0:1:0/block/sdi'
It simply strips off the everything up to the /block.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Diffstat (limited to 'multipathd')
-rw-r--r-- | multipathd/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/multipathd/main.c b/multipathd/main.c index 7304056..30dba5b 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -603,14 +603,20 @@ uxsock_trigger (char * str, char ** reply, int * len, void * trigger_data) static int uev_discard(char * devpath) { + char *tmp; char a[10], b[10]; /* * keep only block devices, discard partitions */ - if (sscanf(devpath, "/block/%10s", a) != 1 || - sscanf(devpath, "/block/%10[^/]/%10s", a, b) == 2) { - condlog(4, "discard event on %s", devpath); + tmp = strstr(devpath, "/block/"); + if (tmp == NULL){ + condlog(0, "no /block/ in '%s'", devpath); + return 1; + } + if (sscanf(tmp, "/block/%10s", a) != 1 || + sscanf(tmp, "/block/%10[^/]/%10s", a, b) == 2) { + condlog(0, "discard event on %s", devpath); return 1; } return 0; |