diff options
| -rw-r--r-- | drivers/md/Kconfig | 6 | ||||
| -rw-r--r-- | drivers/md/dm-mpath.c | 2 | ||||
| -rw-r--r-- | include/scsi/scsi_dh.h | 12 |
3 files changed, 18 insertions, 2 deletions
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig index b4a3c7d1451d..07d92c11b5d8 100644 --- a/drivers/md/Kconfig +++ b/drivers/md/Kconfig | |||
| @@ -252,7 +252,11 @@ config DM_ZERO | |||
| 252 | config DM_MULTIPATH | 252 | config DM_MULTIPATH |
| 253 | tristate "Multipath target" | 253 | tristate "Multipath target" |
| 254 | depends on BLK_DEV_DM | 254 | depends on BLK_DEV_DM |
| 255 | select SCSI_DH | 255 | # nasty syntax but means make DM_MULTIPATH independent |
| 256 | # of SCSI_DH if the latter isn't defined but if | ||
| 257 | # it is, DM_MULTIPATH must depend on it. We get a build | ||
| 258 | # error if SCSI_DH=m and DM_MULTIPATH=y | ||
| 259 | depends on SCSI_DH || !SCSI_DH | ||
| 256 | ---help--- | 260 | ---help--- |
| 257 | Allow volume managers to support multipath hardware. | 261 | Allow volume managers to support multipath hardware. |
| 258 | 262 | ||
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index e8f704aa46f2..9f7302d4878d 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
| @@ -664,6 +664,8 @@ static int parse_hw_handler(struct arg_set *as, struct multipath *m) | |||
| 664 | request_module("scsi_dh_%s", m->hw_handler_name); | 664 | request_module("scsi_dh_%s", m->hw_handler_name); |
| 665 | if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { | 665 | if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { |
| 666 | ti->error = "unknown hardware handler type"; | 666 | ti->error = "unknown hardware handler type"; |
| 667 | kfree(m->hw_handler_name); | ||
| 668 | m->hw_handler_name = NULL; | ||
| 667 | return -EINVAL; | 669 | return -EINVAL; |
| 668 | } | 670 | } |
| 669 | consume(as, hw_argc - 1); | 671 | consume(as, hw_argc - 1); |
diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h index 04d0d8495c83..3ad2303d1a16 100644 --- a/include/scsi/scsi_dh.h +++ b/include/scsi/scsi_dh.h | |||
| @@ -54,6 +54,16 @@ enum { | |||
| 54 | SCSI_DH_NOSYS, | 54 | SCSI_DH_NOSYS, |
| 55 | SCSI_DH_DRIVER_MAX, | 55 | SCSI_DH_DRIVER_MAX, |
| 56 | }; | 56 | }; |
| 57 | 57 | #if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE) | |
| 58 | extern int scsi_dh_activate(struct request_queue *); | 58 | extern int scsi_dh_activate(struct request_queue *); |
| 59 | extern int scsi_dh_handler_exist(const char *); | 59 | extern int scsi_dh_handler_exist(const char *); |
| 60 | #else | ||
| 61 | static inline int scsi_dh_activate(struct request_queue *req) | ||
| 62 | { | ||
| 63 | return 0; | ||
| 64 | } | ||
| 65 | static inline int scsi_dh_handler_exist(const char *name) | ||
| 66 | { | ||
| 67 | return 0; | ||
| 68 | } | ||
| 69 | #endif | ||
