Received: by 10.213.65.68 with SMTP id h4csp378770imn; Fri, 23 Mar 2018 06:39:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELvoJkkqJ9dYRBUAz7nVZx3GO0OUdVVepuLj2E+6CE+/i0Sa1c9+2n7CAtzWphsznV8+sBR2 X-Received: by 10.99.124.7 with SMTP id x7mr20967277pgc.356.1521812380390; Fri, 23 Mar 2018 06:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521812380; cv=none; d=google.com; s=arc-20160816; b=ud+JFXfv/ymzLK2g6I9K9nrxEiMTpjTczQ6/9K95FvGP/j4wEvQA5F3VCNSm7bDN1s 5GQnI33EK5YlOEf7+ZuhTStmyjNXWrrVDR77aG9VftNQYGoR6PrmwcWq//3KaQoX/5PY 1mMrh5v+7WCIGk1GNe679MIbyvmAcHs8z4z12holkCaXELhDqKzUCjCIULhRWFzfMme9 DzezFJNnfyRyyyUeS8cKeGBDyVlT7Qnvg9KGbhjtzCri8OJH0E5vCnuAA+XgApyYxaAx I17sk3PvbiKtNZBCPu34iuf7XEnJQ+w3ywt+EHNrDjhIYjielx+HR89qhBinciJyAS2R YBHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=s4xTNFCTky3J5KbNROmhvGY2OGwHDx6C+rmasUpEwbo=; b=lcDlArjUXFutSKpZ+eQDtPHF4pTlLOzDVkWrZHC4VDRABhG34flUJYQDZ1EHTMYwEs pQiw6blSNnamL8lAsJZyrrdVybWBx4DjY2zELC0pKXraVs/efxY0ODwNmIxIlvMKF1P4 bVppjzbkLKQdmKnvofgkNewv1DuXwVXddhe9bXvDe68YCns0se1jHOjfu+JGGonE83on Z6oWd0XH3ULdCxw+1B8dPeCBjcaRTyBEuEzXQz6j0BUZ2IMKme22yXhduOEkxM1DWYPm nKJCbVJLi+X7NYbK3og55SDcF7NnczcW1iCXVmDxb8YuV6HFU+fCUZOdSMEwLyO85l3v m9PQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s78si1454718pfj.259.2018.03.23.06.39.25; Fri, 23 Mar 2018 06:39:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433AbeCWNhX (ORCPT + 99 others); Fri, 23 Mar 2018 09:37:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:58384 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbeCWNhW (ORCPT ); Fri, 23 Mar 2018 09:37:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4D5C5AB3D; Fri, 23 Mar 2018 13:37:21 +0000 (UTC) From: Johannes Thumshirn To: "Martin K . Petersen" Cc: Linux Kernel Mailinglist , Linux SCSI Mailinglist , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH] scsi: don't look for NULL devices handlers by name Date: Fri, 23 Mar 2018 14:37:05 +0100 Message-Id: <20180323133705.14556-1-jthumshirn@suse.de> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently scsi_dh_lookup() doesn't check for NULL as a device name. This combined with nvme over dm-mapth 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. Signed-off-by: Johannes Thumshirn --- drivers/scsi/scsi_dh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c index b88b5dbbc444..188f30572aa1 100644 --- a/drivers/scsi/scsi_dh.c +++ b/drivers/scsi/scsi_dh.c @@ -112,6 +112,9 @@ static struct scsi_device_handler *scsi_dh_lookup(const char *name) { struct scsi_device_handler *dh; + if (!name || strlen(name) == 0) + return NULL; + dh = __scsi_dh_lookup(name); if (!dh) { request_module("scsi_dh_%s", name); -- 2.13.6