Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1149878pxv; Fri, 9 Jul 2021 19:36:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtJsBxvLZ8Uiey+pWQT+epQD6itjV6c4xJgAivqY6XQZ1KkFrZiwyDYU8gkhQiyagxB2su X-Received: by 2002:a02:a71a:: with SMTP id k26mr34373615jam.90.1625884592905; Fri, 09 Jul 2021 19:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884592; cv=none; d=google.com; s=arc-20160816; b=EudnYPlC8KyIe8Dmn9Uv8uppH73dOsec0Xhn8wT35OEUMnOiJ0LQzcqFjv5UPJp10p AnbCXfyTinJV9KrtnEOZA85Ehoo/pjAKgFaOF9XLQFVcqAxOyrDAbbzdyuiQDWq3MooU CXStr93enTQrXTlBD1AsRVEEc6ewLZo0MAOV9LnZFMvbdROPVxrFcBkMbpzlWM7yo1qr Dcu46yYXLNYi4Cdhu/5K/RvqdA5DBRp7tIurGAbKqRTmRtWoEPgVj4SS0K+22s5UYs7h J4AZEze4bRIQTb/zjIygFnHRCqGavoPfbxbtyClQ/D7BHBoManLQnPPda4EQfcfE/7fR v2Hg== 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=CFKm6a7M2aXMtuJ2ah6Xzv3Im4t3KwqTjQHrIDsHJwo=; b=Eq9xGktheuaKiRMFLattl78cxdWFnRJ+1z4W2ect4++93Bz0E55iFlIgaPy9xtNYRv 8ySBXBUikUvznd7kjv1a4jVUsJIfrkPBDRo7QClRQmAzsoexoitJBNI58zF40P0bYnVF RM9HqHTApvf9tvnArTNsBwaGKT0mW+EmdXSFrF6TQC10ROosfSejI90VMx3OoCaUZtBV wN1wAfpb9NvrKuDT5lPMVAcJ8jwNPPaHk4vloHUd0sn4QnW+Zq3O61umN3qtBZUrseJa 8qJFyj3v/Jb5ah91MFAaAXsSr39gSjcVqkIa1ieZbQuQidBkQb9soDKbNi5WzI2ra5gp U86g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lYeYOLeK; 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 j8si8969449jak.26.2021.07.09.19.36.21; Fri, 09 Jul 2021 19:36:32 -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=lYeYOLeK; 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 S234144AbhGJCig (ORCPT + 99 others); Fri, 9 Jul 2021 22:38:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:53588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235756AbhGJCfD (ORCPT ); Fri, 9 Jul 2021 22:35:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82C8E613E6; Sat, 10 Jul 2021 02:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884338; bh=FouFDJmTwQE7solqH69bOIMe0yKX0MOK+I9G50PhMqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lYeYOLeKTdtAk0Cb8j9xSdl3PX4D+P/OEQHztIq1ajMlP5Q6sxojZMTGxQbVM9u6T S5EA0oTO3f0vwnHGMWkYUCyiXvNuxYk6/EiyHNmW0hGB+4prAwq7yOTx7iNYN1x5BP SGiv/UhGcNJMh90W8Gs3Uy9q5c3VhVzdPAyC4Qz9roZLV6OoSOQl2eKQDZCm5/7Y4a ohrMb/7QS+yzBljUQ9bdzko2CCLsSDMOVxBtIBgZCr4m69XpnmqDb8Xn4UvNzYMxZe LJw3nuRG5i+U4vjnUyy7ncsyRop1imBol+SOvTV8gixGaeNkfn+auD1vu2yg0l1CJw WQEyYeSYpoxLw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hannes Reinecke , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 11/39] scsi: scsi_dh_alua: Check for negative result value Date: Fri, 9 Jul 2021 22:31:36 -0400 Message-Id: <20210710023204.3171428-11-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hannes Reinecke [ Upstream commit 7e26e3ea028740f934477ec01ba586ab033c35aa ] scsi_execute() will now return a negative error if there was an error prior to command submission; evaluate that instead if checking for DRIVER_ERROR. [mkp: build fix] Link: https://lore.kernel.org/r/20210427083046.31620-6-hare@suse.de Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/device_handler/scsi_dh_alua.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index efd2b4312528..41e8c9e68878 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -562,12 +562,12 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg) kfree(buff); return SCSI_DH_OK; } - if (!scsi_sense_valid(&sense_hdr)) { + if (retval < 0 || !scsi_sense_valid(&sense_hdr)) { sdev_printk(KERN_INFO, sdev, "%s: rtpg failed, result %d\n", ALUA_DH_NAME, retval); kfree(buff); - if (driver_byte(retval) == DRIVER_ERROR) + if (retval < 0) return SCSI_DH_DEV_TEMP_BUSY; return SCSI_DH_IO; } @@ -789,11 +789,11 @@ static unsigned alua_stpg(struct scsi_device *sdev, struct alua_port_group *pg) retval = submit_stpg(sdev, pg->group_id, &sense_hdr); if (retval) { - if (!scsi_sense_valid(&sense_hdr)) { + if (retval < 0 || !scsi_sense_valid(&sense_hdr)) { sdev_printk(KERN_INFO, sdev, "%s: stpg failed, result %d", ALUA_DH_NAME, retval); - if (driver_byte(retval) == DRIVER_ERROR) + if (retval < 0) return SCSI_DH_DEV_TEMP_BUSY; } else { sdev_printk(KERN_INFO, sdev, "%s: stpg failed\n", -- 2.30.2