提交 510193a2 编写于 作者: M Mike Snitzer 提交者: Alasdair G Kergon

dm mpath: check if scsi_dh module already loaded before trying to load

If the requested scsi_dh module is already loaded then skip
request_module().

Multipath table loads can hang in an unnecessary __request_module.
Reported-by: NBen Marzinski <bmarzins@redhat.com>
Cc: stable@kernel.org
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 7cab8bf1
...@@ -718,8 +718,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m) ...@@ -718,8 +718,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m)
return 0; return 0;
m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL);
request_module("scsi_dh_%s", m->hw_handler_name); if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name),
if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { "scsi_dh_%s", m->hw_handler_name)) {
ti->error = "unknown hardware handler type"; ti->error = "unknown hardware handler type";
ret = -EINVAL; ret = -EINVAL;
goto fail; goto fail;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册