Received: by 10.213.65.68 with SMTP id h4csp1244806imn; Mon, 26 Mar 2018 03:58:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELuKNbuOU1iCLTWLn7wCdZ78qcKse6zKxDxeM09zu6uoe7wmT+d1//L0hMaSN7ZrNCJfqskO X-Received: by 2002:a17:902:158b:: with SMTP id m11-v6mr39846190pla.300.1522061896969; Mon, 26 Mar 2018 03:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522061896; cv=none; d=google.com; s=arc-20160816; b=HUzWwvA2UiQC4p6Jo3goY0VJdmuAMnaFcRAMkGQ+xBjeevhJdLT1Adh5zILOhY7S+y O55Zwlg/N3T0fTmrFVLKn1D/47hClQaPtdkHw9J5L9IuNj7T0RMjlTzVkCUMz9B6mcsC C3HWhqNSpcXHUKm1tnlwyaWQY8AVRSb/G/itCX+uVN8WBI4NBUUjqG6zXlu3shm30q01 NqvWGPq1myKXPXA0a5Rh5VNLjiO95/8iWW8W5JFtL0ZgyyGgbr6T1zBVIxv3xsnhgHEH 5bcnHIu96PzhuPn1+vKpaIwIjubSW7fLpLF/ag2UxzDAoKFI4VTGdp0RF1z8QHuCaGxT vbvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=ujv7jMcxvoGb/DkhZbjIPpe8Ja+e7ZOdvp/lMvWops0=; b=RrcJTYgLaU9fcVg9pqR0NCu3661+nOvd2HX/ytiLtyLV/eVthqQyemoaxiXpStOzpE o3hSdbJzsE6zxzq/V7NfEi56VYFbm7N6Gc7eKjqt5kG5GvezE4G1A5tOUjDP3UINP0IY 5ymCMbHeBspmloXinIpiWIwsdHoKWjzOv4oFWAKWlNt0/FCVE69SjbW+UVshAWXf2vou xewyJVKJvi02lc/UirdjNL3DoyGjhV4iqXzmcbAY3PD8V9Jc7R8V+B/3gLrdXNgf1a1R +xsCnnRFGc4vwqxD9J4mBY+qi4TY1xtc/uq8rVjAyJO/9glP1Bl9V3Lzyv3MIcpQ5ARB Sq/w== 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 d63-v6si3334879pld.23.2018.03.26.03.58.02; Mon, 26 Mar 2018 03:58:16 -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 S1751912AbeCZK4l (ORCPT + 99 others); Mon, 26 Mar 2018 06:56:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:33874 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbeCZK4k (ORCPT ); Mon, 26 Mar 2018 06:56:40 -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 66326AF59; Mon, 26 Mar 2018 10:56:39 +0000 (UTC) Date: Mon, 26 Mar 2018 12:56:38 +0200 From: Hannes Reinecke To: Johannes Thumshirn Cc: "Martin K . Petersen" , Linux Kernel Mailinglist , Linux SCSI Mailinglist Subject: Re: [PATCH] scsi: don't look for NULL devices handlers by name Message-ID: <20180326125638.2510d7dd@pentland.suse.de> In-Reply-To: <20180323133705.14556-1-jthumshirn@suse.de> References: <20180323133705.14556-1-jthumshirn@suse.de> Organization: SUSE Linux GmbH X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 23 Mar 2018 14:37:05 +0100 Johannes Thumshirn wrote: > 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); Reviewed-by: Hannes Reinecke Cheers, Hannes