From patchwork Thu Dec 3 07:17:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 7756801 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 38135BEEE1 for ; Thu, 3 Dec 2015 07:17:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 715FB2054C for ; Thu, 3 Dec 2015 07:17:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FD512057E for ; Thu, 3 Dec 2015 07:17:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756666AbbLCHRt (ORCPT ); Thu, 3 Dec 2015 02:17:49 -0500 Received: from mx2.suse.de ([195.135.220.15]:56203 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbbLCHRr (ORCPT ); Thu, 3 Dec 2015 02:17:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CA9E3ABE5; Thu, 3 Dec 2015 07:17:44 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Hannes Reinecke Subject: [PATCH 5/5] scsi_error: do not escalate failed EH command Date: Thu, 3 Dec 2015 08:17:43 +0100 Message-Id: <1449127063-94512-6-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1449127063-94512-1-git-send-email-hare@suse.de> References: <1449127063-94512-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When a command is sent as part of the error handling there is not point whatsoever to start EH escalation when that command fails; we are _already_ in the error handler, and the escalation is about to commence anyway. So just call 'scsi_try_to_abort_cmd()' to abort outstanding commands and let the main EH routine handle the rest. Signed-off-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_error.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index cf47b81..0159498 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -870,15 +870,6 @@ static int scsi_try_to_abort_cmd(struct scsi_host_template *hostt, return hostt->eh_abort_handler(scmd); } -static void scsi_abort_eh_cmnd(struct scsi_cmnd *scmd) -{ - if (scsi_try_to_abort_cmd(scmd->device->host->hostt, scmd) != SUCCESS) - if (scsi_try_bus_device_reset(scmd) != SUCCESS) - if (scsi_try_target_reset(scmd) != SUCCESS) - if (scsi_try_bus_reset(scmd) != SUCCESS) - scsi_try_host_reset(scmd); -} - /** * scsi_eh_prep_cmnd - Save a scsi command info as part of error recovery * @scmd: SCSI command structure to hijack @@ -1063,7 +1054,7 @@ retry: break; } } else if (rtn != FAILED) { - scsi_abort_eh_cmnd(scmd); + scsi_try_to_abort_cmd(shost->hostt, scmd); rtn = FAILED; }