diff options
author | Mike Snitzer <snitzer@redhat.com> | 2012-05-12 04:43:21 +0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-05-21 01:56:42 +0400 |
commit | f6fa1ed89c2778e9755c9d1081bdb7cab38fbfb4 (patch) | |
tree | 7475ef7242066da4faa09a07a611d64e77bc1c59 | |
parent | ab13af236947f28b3245591f4c2c20085ec9e91e (diff) | |
download | linux-f6fa1ed89c2778e9755c9d1081bdb7cab38fbfb4.tar.xz |
dm mpath: check if scsi_dh module already loaded before trying to load
commit 510193a2d3d2e03ae53b95c0ae4f33cdff02cbf8 upstream.
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 <bmarzins@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/md/dm-mpath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 801d92d237cf..a417f947605d 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -698,8 +698,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m) return 0; m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); - request_module("scsi_dh_%s", m->hw_handler_name); - if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { + if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name), + "scsi_dh_%s", m->hw_handler_name)) { ti->error = "unknown hardware handler type"; ret = -EINVAL; goto fail; |