From patchwork Thu Apr 5 17:32:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10325101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E58ED60545 for ; Thu, 5 Apr 2018 17:33:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6F5B2931B for ; Thu, 5 Apr 2018 17:33:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBE3E29326; Thu, 5 Apr 2018 17:33:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E60D29327 for ; Thu, 5 Apr 2018 17:33:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751439AbeDERdO (ORCPT ); Thu, 5 Apr 2018 13:33:14 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:45468 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbeDERdL (ORCPT ); Thu, 5 Apr 2018 13:33:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1522949591; x=1554485591; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=NSw3MPmCkZOI+XmC6HJ8kLTxhieaVbTK1NU2jg7pdw0=; b=loZKyP9EzARw+GpnVeaxOTuOS+uruwIjTH+873Lp/WOa5gCC/x6Aj8yL 4iakJrqMzhVyLUHZt/+MhOoEnISe23Xp1K4acOr3XDKPaTXAjqkZlTcTm Rq1w9vhWVE8R6p26fAMFu0eU7or7YTvLcD5AxAVZ+yR04C7Pi4aQrtip4 uD68p0l54HZix1Fx3l3cUZQG1xwFcEPcgDmmtsYHXS3qKvloHL2MkE+yH wPN4mKDyyuOxW7Oj9QtQ127Aw+Qji7SWbIdJGttLKjp6NywKCxzoyi6tD fURobdy5BMbZasd2TdRB1NB2Dnhs+RTDDtDLXZkx5FrsnjMNeIwan9re1 w==; X-IronPort-AV: E=Sophos;i="5.48,411,1517846400"; d="scan'208";a="75345215" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 06 Apr 2018 01:33:02 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 05 Apr 2018 10:25:52 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com (HELO thinkpad-bart.int.fusionio.com) ([10.11.171.236]) by uls-op-cesaip01.wdc.com with ESMTP; 05 Apr 2018 10:33:03 -0700 From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke , Douglas Gilbert , Damien Le Moal , Christoph Hellwig , Lee Duncan , stable@vger.kernel.org Subject: [PATCH v3 1/3] Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()" Date: Thu, 5 Apr 2018 10:32:59 -0700 Message-Id: <20180405173301.13186-2-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180405173301.13186-1-bart.vanassche@wdc.com> References: <20180405173301.13186-1-bart.vanassche@wdc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The description of commit e39a97353e53 is wrong: it mentions that commit 2a842acab109 introduced a bug in __scsi_error_from_host_byte() although that commit did not change the behavior of that function. Additionally, commit e39a97353e53 introduced a bug: it causes commands that fail with hostbyte=DID_OK and driverbyte=DRIVER_SENSE to be completed with BLK_STS_OK. Hence revert that commit. Fixes: e39a97353e53 ("scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()") Reported-by: Damien Le Moal Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Douglas Gilbert Cc: Damien Le Moal Cc: Christoph Hellwig Cc: Lee Duncan Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 1d83f29aee74..c0e4ae733cce 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -733,8 +733,6 @@ static blk_status_t __scsi_error_from_host_byte(struct scsi_cmnd *cmd, int result) { switch (host_byte(result)) { - case DID_OK: - return BLK_STS_OK; case DID_TRANSPORT_FAILFAST: return BLK_STS_TRANSPORT; case DID_TARGET_FAILURE: