If the requested scsi_dh module is already loaded then skip request_module(). Multipath table loads can hang in an unnecessary __request_module.
Unified · Split
| @@ -718,8 +718,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m) · 717 unmodified lines | |||
| 718 | return 0; | 718 | return 0; |
| 719 | 719 | ||
| 720 | m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); | 720 | m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); |
| 721 | request_module("scsi_dh_%s", m->hw_handler_name); | 721 | if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name), |
| 722 | if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { | 722 | "scsi_dh_%s", m->hw_handler_name)) { |
| 723 | ti->error = "unknown hardware handler type"; | 723 | ti->error = "unknown hardware handler type"; |
| 724 | ret = -EINVAL; | 724 | ret = -EINVAL; |
| 725 | goto fail; | 725 | goto fail; |