Skip to content

Commit 510193a

Browse files
snitmkergon
authored andcommitted
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: Ben Marzinski <[email protected]> Cc: [email protected] Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
1 parent 7cab8bf commit 510193a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/md/dm-mpath.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m)
718718
return 0;
719719

720720
m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL);
721-
request_module("scsi_dh_%s", m->hw_handler_name);
722-
if (scsi_dh_handler_exist(m->hw_handler_name) == 0) {
721+
if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name),
722+
"scsi_dh_%s", m->hw_handler_name)) {
723723
ti->error = "unknown hardware handler type";
724724
ret = -EINVAL;
725725
goto fail;

0 commit comments

Comments
 (0)