提交 2ee5671e 编写于 作者: J Johannes Thumshirn 提交者: Martin K. Petersen

scsi: scsi_dh: Don't look for NULL devices handlers by name

Currently scsi_dh_lookup() doesn't check for NULL as a device name. This
combined with nvme over dm-mpath results in the following messages
emitted by device-mapper:

 device-mapper: multipath: Could not failover device 259:67: Handler scsi_dh_(null) error 14.

Let scsi_dh_lookup() fail fast on NULL names.

[mkp: typo fix]

Cc: <stable@vger.kernel.org> # v4.16
Signed-off-by: NJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: NHannes Reinecke <hare@suse.com>
Reviewed-by: NBart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 cbee67c2
...@@ -112,6 +112,9 @@ static struct scsi_device_handler *scsi_dh_lookup(const char *name) ...@@ -112,6 +112,9 @@ static struct scsi_device_handler *scsi_dh_lookup(const char *name)
{ {
struct scsi_device_handler *dh; struct scsi_device_handler *dh;
if (!name || strlen(name) == 0)
return NULL;
dh = __scsi_dh_lookup(name); dh = __scsi_dh_lookup(name);
if (!dh) { if (!dh) {
request_module("scsi_dh_%s", name); request_module("scsi_dh_%s", name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册