Skip to contentSkip to conversation

dm mpath: only try to load the scsi_dh module if the scsi_dh doesn't exist

PATCH Superseded Mike Snitzer 1 participant 1 message May 1, 2012 Device mapper

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm mpath: only try to load the scsi_dh module if the scsi_dh doesn't exist

There have been reports of multipath table loads hanging due to __request_module hanging (for some unknown reason).

More often than not, the scsi_dh is already available and there is no need to request_module().

---
 drivers/md/dm-mpath.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-mpath.c +2 -2
index 922a338..754f38f 100644
@@ -718,8 +718,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;
Signature · 1 line
1.7.1