Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2291820imc; Tue, 12 Mar 2019 10:43:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuzlcnCYqDeIpIyXdwcGKadplzAz1PWCR9lspKe4rMGSdUdl6ZSz1tHG/r/Be4xAKZuw+v X-Received: by 2002:a65:63c8:: with SMTP id n8mr35753620pgv.158.1552412606099; Tue, 12 Mar 2019 10:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552412606; cv=none; d=google.com; s=arc-20160816; b=GUj1QuKqOa/Yp4UES1Tt9J1/yUnvGCjDbqSTeYdiOD9rVO1y7ZIQeOzHd01ZvUn7NR mxcT1/yRzu82LPRWvmHCOVRugmiIpRcTjG//+30xHeTOpVnEDB1FGemcdrkLd1M+p6k4 wFFvtkzADKdhTq344ZsiNpsf2pQO9I8y0z8JkCeEeoDPsH6lTLmISgqxBORYn5/lcqyU WLUol5LujbPDjhgP5ynsPdDiiiPYwB2j66fYs5Lw92EYrPo9l47CJG/r3asWRKMTAlT/ 64FrfRELwGfu3IAXwgXPy12GlOwt0CayvUdn9mjHlJpzdGMDHmUKN/wxdYEgTcIEgX4v a7qA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bFVVzVGW1p1vKN4lkDGVgyMwb542wEGvY0HUik5r0Uw=; b=NQMXg30IWikFp0nY3lioJhs6c08w9ssdM8mkIFXsgPEezJ6ZAFfofYAMCed6ezkrcG RFCJc3nkDdiP6nzNIcygA6H6BUT9fWLO48845AYt2hQShPR5vRq0B8dIgen85jGQRUQT lbOf2piYBofkknKbqyciNv633twb7otrcmcz4gATUhJMv934+duOdm23lPegvwrrq0C0 NHBqeY1H+8nSiO16/G7AJ31UXhM61oFj47jOAQ0xI49x6lYU+53YYOxVVn/IFQrbX9V/ rXgpMpfG+pCMvknd24x0/owO0cxiOE3sJM0sb29f4HmhRj6cLVujX262YKIAiMg55YN/ B9/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jT27sF3o; 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 h8si8341480pls.365.2019.03.12.10.43.09; Tue, 12 Mar 2019 10:43:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=jT27sF3o; 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 S1729262AbfCLRlG (ORCPT + 99 others); Tue, 12 Mar 2019 13:41:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729012AbfCLRQI (ORCPT ); Tue, 12 Mar 2019 13:16:08 -0400 Received: from localhost (unknown [104.133.8.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4DA7D2184C; Tue, 12 Mar 2019 17:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552410968; bh=XU67G5XOL4N4jzUf++QxMY3ufhmGL7RNjwAQa+ulkDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jT27sF3oT4jcjb+fVdX+6JAqnQEUdGMNxQYSzM9JcGlPWXL47q1nWxyt++l2Pig8k C1jpIJ6RPCd7J9J3TqSYkwpgQoZLI0WiNB27q62+EvgW79q/pxlxoqAP06uARMt+El aVddp+Xrlu8UmXTV/8dASuKP19AaUAbKFCRHfBNY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Wilck , Hannes Reinecke , Christoph Hellwig , "Martin K. Petersen" Subject: [PATCH 4.14 042/135] scsi: core: reset host byte in DID_NEXUS_FAILURE case Date: Tue, 12 Mar 2019 10:08:09 -0700 Message-Id: <20190312170344.997704446@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190312170341.127810985@linuxfoundation.org> References: <20190312170341.127810985@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Martin Wilck commit 4a067cf823d9d8e50d41cfb618011c0d4a969c72 upstream. Up to 4.12, __scsi_error_from_host_byte() would reset the host byte to DID_OK for various cases including DID_NEXUS_FAILURE. Commit 2a842acab109 ("block: introduce new block status code type") replaced this function with scsi_result_to_blk_status() and removed the host-byte resetting code for the DID_NEXUS_FAILURE case. As the line set_host_byte(cmd, DID_OK) was preserved for the other cases, I suppose this was an editing mistake. The fact that the host byte remains set after 4.13 is causing problems with the sg_persist tool, which now returns success rather then exit status 24 when a RESERVATION CONFLICT error is encountered. Fixes: 2a842acab109 "block: introduce new block status code type" Signed-off-by: Martin Wilck Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/scsi_lib.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -734,6 +734,7 @@ static blk_status_t __scsi_error_from_ho set_host_byte(cmd, DID_OK); return BLK_STS_TARGET; case DID_NEXUS_FAILURE: + set_host_byte(cmd, DID_OK); return BLK_STS_NEXUS; case DID_ALLOC_FAILURE: set_host_byte(cmd, DID_OK);