Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2917756pxb; Tue, 24 Aug 2021 10:33:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzot0pHjZabEFHZ+a8pk2/3Rl7hxOa7nOHaw9KKC5udvnB2O2dfAFNqe/ZtBUIoaCMbwg84 X-Received: by 2002:a92:d60f:: with SMTP id w15mr28050884ilm.209.1629826411119; Tue, 24 Aug 2021 10:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629826411; cv=none; d=google.com; s=arc-20160816; b=sRHGFAMvFKR5RrxM2f/RJI0Ei7uG9lwmrA1pF68kjVO1+AKiuj4OkXtmeiOhTolzVu W19wa2u9kK/x7Ph3RHlupffl82bGQLiKkTez8XRv4ISQ/83uzJu1CCSgEM83rvdDxDVB HykFdJYGWn1FZhIUsGEwCe5ScJQZT2vWFWNq/aGlDMIpFHk0speeW4FUU8qBb8odKP1C iIGLN18IqnKYqSJXNvWLkgQPMqzLQlTub253FO1v2n1zTYgKAwb5ig61UuiLKEpjtTSC nXo094TezKEEEI6vyFOzNtUxtAiqTpyqhx7abWfaEmSynsbtwy8gC5MVHjXWuucLYYLH 1qJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ux0yS9aCHcFGPMqWWuARzX2yua1BNrZJY42y0L6BXDw=; b=Ju9o6cTvqjwcDp8ooONMW9SbfgztithlKmSv4XP+l3TjnuFpHTD/4Hx6Jkl5BMQe1c T/0WaEHhctkjGDZsOjT0/qBfr6qJoTXi9QwFyY6gw5rSrNSAd4V7cQS2NCBDtCc4KIv2 yO6t5i4dNhUcpd2CkkvFOjiSSuhg4PpGZxV/+L0AFYn95vVG3tEaAje8MulMat0Qefd2 qTkpO9VIIkROvqqpYXsRb3mUJZu3hEu7R1PDFJrqjjl5T3s9Tb7v0xCoWfa9F2X7DzwM F5NCne7o3T8kEHmwL1VI0KHCr4DWf6dVq6fLpZ6/oF01wcgxSb8344vVdCatHbhS/7n/ 8ZTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RjqMmsSm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t11si18813048jal.119.2021.08.24.10.33.16; Tue, 24 Aug 2021 10:33:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RjqMmsSm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240476AbhHXRdQ (ORCPT + 99 others); Tue, 24 Aug 2021 13:33:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:35536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239673AbhHXRan (ORCPT ); Tue, 24 Aug 2021 13:30:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 54F3C61B5D; Tue, 24 Aug 2021 17:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824740; bh=sJ2imIScDrbHpEF5E/7Kj7O/+S7DmbkGg5TtuFP58Zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RjqMmsSmDBkEywQDddIO4RM2rMs3FivQ/FvV3C5S6Y+mBRZ/Xch9n39jr82w6v/v8 n82DyeyN2vdRGDZY8qMFohbb6B//lvaCZMFkya9i5rDpXhdF/nTFrzPrBd+/v3aJvv NO8HJP7a+lsnYnW6rLwo2vNX38Cpx84GWnHygwoPDburZP3b3o+RoO3izuogcfn/pb +4bJ6x7R4ggArullrvHlgovvtQ8FegGS2nQqmczvTYCpWXUQ0140CQ1gPlHDM69J8L t0TVOyOrhAJklx1b1eHs/6GIGpBtzMM9VBeIqZqKztMk8QXaxQ3SgEm9K533kj6CAT 8aMxtn4GDrBhg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sreekanth Reddy , "Martin K . Petersen" , Sasha Levin Subject: [PATCH 4.14 44/64] scsi: core: Avoid printing an error if target_alloc() returns -ENXIO Date: Tue, 24 Aug 2021 13:04:37 -0400 Message-Id: <20210824170457.710623-45-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824170457.710623-1-sashal@kernel.org> References: <20210824170457.710623-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.245-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.14.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.14.245-rc1 X-KernelTest-Deadline: 2021-08-26T17:04+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sreekanth Reddy [ Upstream commit 70edd2e6f652f67d854981fd67f9ad0f1deaea92 ] Avoid printing a 'target allocation failed' error if the driver target_alloc() callback function returns -ENXIO. This return value indicates that the corresponding H:C:T:L entry is empty. Removing this error reduces the scan time if the user issues SCAN_WILD_CARD scan operation through sysfs parameter on a host with a lot of empty H:C:T:L entries. Avoiding the printk on -ENXIO matches the behavior of the other callback functions during scanning. Link: https://lore.kernel.org/r/20210726115402.1936-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/scsi_scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 40acc060b655..95ca7039f493 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -462,7 +462,8 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, error = shost->hostt->target_alloc(starget); if(error) { - dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error); + if (error != -ENXIO) + dev_err(dev, "target allocation failed, error %d\n", error); /* don't want scsi_target_reap to do the final * put because it will be under the host lock */ scsi_target_destroy(starget); -- 2.30.2