Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1146758pxv; Fri, 9 Jul 2021 19:30:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKqsqCOA13bHA9nR7KqwUa8+NU2rsli/kMmDgXDSCVQb+yb7hkj0Mc3Ay/7yfYsUNXGuJR X-Received: by 2002:a50:c907:: with SMTP id o7mr49827763edh.120.1625884207471; Fri, 09 Jul 2021 19:30:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884207; cv=none; d=google.com; s=arc-20160816; b=byc/sVqpc0KHjPFd35nkqNFoE7BEY8wLri4xVNwhKjjvjOOIUBZGx/OiRfLHbWMUop 2YHj77R3wsTTs2w4XG5MOs4lrPyA4o98G3zdcgQOthBRo2o6brmQlTfgKUa5JhV0uAJA y3r4/Fn9z3Yui7HnSRqK2dm6BncPl9wvN+gGaDfzbsgzd4j9J3y8Vh/7Bdd0MK/nEAnH oyNTQRiHOKRQclFb9cbLHQNfkyaw+zcbyukt0KVuS86opQ1Euqe70rj5iaMJS2EDejiz i2KbQU0+hA0S0wnaf3p0YR/1l6Pw9zdRVI9Aod2zgVGUlgsuq5AdPuV92O/f2LbLhhka U3IQ== 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=A+kwklpoblb8qSZNTdmbcpdH+D20wYTGCA/XQNpELNA=; b=tvZKj1ctXpGNdvOzIjZTGcXznrerlcpceHCHIRkcXaREeP8ZpwL8E5Q6Xuh30zYG2Q Ffim1TGOTO9aWels1ryKk5VJP/djqRP3EYTkE+JBzkO0MZMhnxZpApsGM87inasS8wA2 m9RTEEbbhrot79DDdcHuTDosp2V+Zw3cueA8qwfQFUdnbtx4wzmBhSA6P+9ILRGavyJU WT8g4vmybq+YcABMv1J+s2DSV4DkXwurnO3mIUdEnTMTl8op/DMMuO2KlkWKMGQr7HJX mP6ZHzIJLRUlGlPqE7a+llqEj6UxH7w/rDooTJAwYOsMXE9uAfVHtqLYwbS/1UeL34nX S3Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rmeREEa1; 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 g18si9384358edw.9.2021.07.09.19.29.44; Fri, 09 Jul 2021 19:30:07 -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=rmeREEa1; 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 S232746AbhGJCba (ORCPT + 99 others); Fri, 9 Jul 2021 22:31:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:43326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233829AbhGJC2S (ORCPT ); Fri, 9 Jul 2021 22:28:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 275CD6141E; Sat, 10 Jul 2021 02:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883910; bh=JPtE6/POe2kzDiNAsnf2rJwrMZwZuBqlLA51f9qPsE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rmeREEa1SADrSV3P5GBGeq+y/0yimPz0dpdu6PGid/RSDmAXuKnuGeVaLPSoIGDqd rEY7SuUKCXv4f03MY/MVwVorhahf2SYTc89Pv3N5yy0QT1lQKBEEWPOum9x9Yl2KAF c3pT2GFzQAJQUs7+P4rT9q7Gn8DCIIL19O/HxYWbI91EsJcKNM+96E7byg6zCmPGCL MV258sc0YMKeoeITpEhD7TL3UtROzIP/w/VppaBVcyERlfMhmnifhJ1B4+HTdJBRjf 799o+M3ZdFO8Lw7M6DIF0lve7CPMZFUFBcLQFpci4cW536lG75Oivd5+Ymm8Xtl4YF b/gqfdCLeiSMQ== 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.10 32/93] scsi: scsi_dh_alua: Check for negative result value Date: Fri, 9 Jul 2021 22:23:26 -0400 Message-Id: <20210710022428.3169839-32-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-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 df5a3bbeba5e..4743317a269a 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -548,12 +548,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; } @@ -775,11 +775,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