Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1145466pxv; Fri, 9 Jul 2021 19:27:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylgrIs3NyKiicPXw+Sw1/W22H9dOtzNhu7KPaRXzYaSo1Mu6pWwPpbNsHWGplxr/RCxKP/ X-Received: by 2002:a05:6402:2023:: with SMTP id ay3mr10910488edb.383.1625884054236; Fri, 09 Jul 2021 19:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884054; cv=none; d=google.com; s=arc-20160816; b=NEbXfrPhYW/s6ZMdOyHRNvhaMKGQSxTB1bANO28J1jhQHmHNGuz+gCxCVRcCfBf5CO g4BsZlliSiL72FttNPQ0dq2VcGAC77XspZ+YFTDsHytcl/fbaIIUAPBtzgUmpOzL2743 hYWpQjBjbdcex1NEBWPmX/OaaKSDhVYjsOe1aDv1bMWIUSk9jryPGDpdXQ1HkLmQRY2F CICY7rcoL+q68vKKUIfzehw5CBThVR0LTN+FTtCt8NvQH8gJkWfwFajuQEl6BnPTMgol C0v/vtCSsKvq9C8TXrCVYY86aTFvyAC1/aBqdKozmtY/WHDWvqXaHwwI5rjSq1bKx3Ih qRnw== 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=gsKxiCygyiPYavNjcKUCRBzFQcxt90mju+8ntbsV+j8=; b=iXjFRM93/viiRsoFMrKTxKXJBUSOAJYGhYBHl6k/Hp0tI/BiITCzAYe4WUK6pSm2oP /Kri1FnrAC1Eq4cUoUk9enFPJZwph9k0z4a14UwCmbLO5p1A6NbAnpPVJ4BngtDQgGKH KSB52MTqNs6GbdBcZEpXbb2cvLvDDCPYeQHQwC3kUu6q/xs3wG97umatTL/De50Zh9Sf gnc+G9cEUCkSUeCxyWpW+ETWe2tc2FLDdBDL+ChrB7JqIaj+ScBlHC7OkfTCiSVABWNH 56R3XupXslyM/eGMVxOHEXcsnq9zzULsB3Xx9Wn5Omw/t/tok/sx4w3cztuQOXO2lNNq AxHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jVXkfe+G; 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 l4si9305591edc.31.2021.07.09.19.27.11; Fri, 09 Jul 2021 19:27:34 -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=jVXkfe+G; 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 S233495AbhGJC0Q (ORCPT + 99 others); Fri, 9 Jul 2021 22:26:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:41906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbhGJCZY (ORCPT ); Fri, 9 Jul 2021 22:25:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C7121613BE; Sat, 10 Jul 2021 02:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883760; bh=AbNyCbZNiK60V/um7+KFhnhixhlP5qeh0fyTIA9Go/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jVXkfe+GaODi/cBsIl3mVFQt/JmP1lEWZ6aX2n21SwF9NixNotlQPc0llnNr4Vq2s hlmEOspjePtVWumHgnvEzAkrHMakjYLFKbkI40Fn5xHkFMrQGL8vDxJQpTEHMEi9MX dgHdj1M/gjh7wRgJ3PSLsZ22CRl9kX1kdaen3K4sfIZK5JTt/gm5rM54oq5/WMHzk8 DlDmePUF2rEMSpmt+ZwpDVotsOh8FOEpdJK/PDfXbWmLmv9TLeUgONYFPoxegtwbtq CeJU2uapkq2TcsWsy7A1jDxPfQAPgQyDpZrZc6T57h0dUCaN5TxkDH9PFIKMmxdtug N/6w6bFqAKtpw== 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 5.12 034/104] scsi: scsi_dh_alua: Check for negative result value Date: Fri, 9 Jul 2021 22:20:46 -0400 Message-Id: <20210710022156.3168825-34-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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 5eff3368143d..c625607a4dfb 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -556,12 +556,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; } @@ -783,11 +783,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