Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp54528pxm; Tue, 22 Feb 2022 06:16:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1ztvS+oFY7ZECaJ88MoCoRtIgH3Le6rI6stNSkUqbpQVf4JXZVM/JzhpbaDqNDPn51ubc X-Received: by 2002:a62:7990:0:b0:4e0:5ae8:6c11 with SMTP id u138-20020a627990000000b004e05ae86c11mr25224730pfc.34.1645539393551; Tue, 22 Feb 2022 06:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645539393; cv=none; d=google.com; s=arc-20160816; b=R0LhjK6pQfs6zezOT9wToK6uhIWjLwm7N43Qik+78IAOed6YoikajCCOt5CyR0TmX7 Y7Eh+o/Bwne/WNdwucBYo6z26vhoTWTDUwhQlOlmNJvW813aOk6lcS5kwOhcVs9n16qC IrwkPyMilg72hX8r47sgOlJRTMfYZSvwrOSr4cA+XZzJgsyxMKWdqcMRaQsRKtSmnj0B pSDouzMgUCibyvmn9L+Uaq+xHAsfztdNFo6SM3aDAU9dzoT8NZO/yYW9ZuklLPJ5NMta Sv092UfabSepswLlA6wAF2XQqCEoyObnnppUe3NWjJPMSkNx7Y4LbCj5FQiQ5Bz1tGXp mBKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=RtmdtnTTVCXTOs2pM6HLSNwkx+4IdDiEK43UEPxLZCA=; b=s8rVGChV7fSyYfZ4m+Yvpzft8Bqui25H4COt5cjOPbKcBbl9FL6tmQurOCeE2j5RgO wklUuGJhrXrLb/0QZJz9LJyvIImmsznECOuHu9HJX0dYHxfuzNiqVMDcbRs7EdcBqXTi IhRpOhQJPfd+1a8abXaC3JqnVaU2c+zjdUgu6tDTbbvfGEOfMk1t4hBFzdXkVFurNC10 QcJawK/lCdoJwhE4QrYR2aiAb7oXl2tTIlTvIa0xh6CuMwBikMRexQfVL8TxKjT4d5AF Rv4woD6YqL0wJErxZKWkaAsOe14OsnvWEa42iOjBWIKTZ5AIfz2oEoKbJroWKCMO0BJj I01Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t19si17496987plr.173.2022.02.22.06.16.12; Tue, 22 Feb 2022 06:16:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232077AbiBVM5I (ORCPT + 99 others); Tue, 22 Feb 2022 07:57:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232063AbiBVM5D (ORCPT ); Tue, 22 Feb 2022 07:57:03 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D440520189; Tue, 22 Feb 2022 04:56:37 -0800 (PST) Received: from fraeml707-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4K2zft1mw0z67Xkw; Tue, 22 Feb 2022 20:55:34 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml707-chm.china.huawei.com (10.206.15.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 22 Feb 2022 13:56:35 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 22 Feb 2022 12:56:32 +0000 From: John Garry To: , , , , , , CC: , , , , , , , , John Garry Subject: [PATCH v3 01/18] scsi: libsas: Handle non-TMF codes in sas_scsi_find_task() Date: Tue, 22 Feb 2022 20:50:42 +0800 Message-ID: <1645534259-27068-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1645534259-27068-1-git-send-email-john.garry@huawei.com> References: <1645534259-27068-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org LLDD TMF callbacks may return linux or other error codes instead of TMF codes. This may cause problems in sas_scsi_find_task() -> .lldd_query_task(), as only TMF codes are handled there. As such, we may not return a task_disposition type from sas_scsi_find_task(). Function sas_eh_handle_sas_errors() only handles that type, and will only progress error handling for those recognised types. Return TASK_ABORT_FAILED upon exit on the assumption that the command may still be alive and error handling should be escalated. Signed-off-by: John Garry Tested-by: Damien Le Moal --- drivers/scsi/libsas/sas_scsi_host.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index bcb391b0c7ed..19cb954afd80 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -316,11 +316,13 @@ static enum task_disposition sas_scsi_find_task(struct sas_task *task) pr_notice("%s: task 0x%p failed to abort\n", __func__, task); return TASK_ABORT_FAILED; + default: + pr_notice("%s: task 0x%p result code %d not handled\n", + __func__, task, res); } - } } - return res; + return TASK_ABORT_FAILED; } static int sas_recover_lu(struct domain_device *dev, struct scsi_cmnd *cmd) -- 2.26.2