Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp288034rdb; Thu, 30 Nov 2023 05:04:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWAzHOgzTneHoiG5lBRagNA6K7BbLUlMpllFeAhsCUZLW/nkuV/WeT4FpyArVirAjaKngF X-Received: by 2002:a05:6a20:728b:b0:18b:c8f8:e539 with SMTP id o11-20020a056a20728b00b0018bc8f8e539mr25193272pzk.42.1701349469812; Thu, 30 Nov 2023 05:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701349469; cv=none; d=google.com; s=arc-20160816; b=ywAcOYfhjbEPDVde9PtjGF/g5Ao+zbgBeQ+om5LIr6UTEc0taTL2aXtMigFXuD6Byj QRyT6D9YY94xdRRpIPSzF3R8AWN89UJ2O0vm1ChBkgMoy/eo+UScVZR/rdoENMcX5OxA h763RWdvEafsHxCpDYjBcDd8fAxGyj3XlFVVcTCqQHE1y3J6bp7uX/dnRA46nl2ZTyfL oQ24VgtPRcDx5A7GA6zQTGJYyy7n1+25/lYWNoJqe159zH/q/bgfSdhKonPdQgw6S3ON wZiV66x4CQM4fznf5s0nWRFApJINdLB1uB64d+c8G4zcTvG39nGTeoXenD2PLk1Py3rL d/IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=/GMUdYnoec85kaYsDI7DHYY1OS0OmP3hXdolIvopwk4=; fh=lLe8NoVVmEmysVgSqTZYlhODssQdAb0Zio5XUQnN4uk=; b=aoX5f/GeRHGR7j8eWFvqjZGdVJU0aHyhcWDn5c8CY0OGxroMnwHDHg5gLbPMWXAYxz /iMa9MuvllZXE6Te/2BIQObIC19ftmHs33JNSlAWwqrq/n+9daWljP2ZL3SWX2zK2Ga9 MSV29wH5AlJpTqdwxJYaXnxGT735asYXD/Aik8Imjgc6Wges0LDG4kBUBH41F2b0FE3d 4tY4g+FSAyt3V1Obr9eDPu+tq8lzIwGObBxd0cmpsmf9VUPBPUedje6VoQe14Glu82cA gOX5eDD3I+Xq6mDUxrBc/KwsalAcDJp/3pxSEHNGbfDfjiW8VHnZ7boFzRHcKC7ucdR9 sR4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 33-20020a631061000000b0059c0f9ef964si1214914pgq.635.2023.11.30.05.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 05:04:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 512F380909CE; Thu, 30 Nov 2023 05:04:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232088AbjK3NEM (ORCPT + 99 others); Thu, 30 Nov 2023 08:04:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231990AbjK3NEL (ORCPT ); Thu, 30 Nov 2023 08:04:11 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0C7F10D1; Thu, 30 Nov 2023 05:04:17 -0800 (PST) Received: from dggpemd100001.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SgxBW1K0WzsRS5; Thu, 30 Nov 2023 21:00:35 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by dggpemd100001.china.huawei.com (7.185.36.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Thu, 30 Nov 2023 21:04:15 +0800 From: Xingui Yang To: , , CC: , , , Subject: [PATCH] scsi: libsas: Put the disk offline if all recovery actions fail Date: Thu, 30 Nov 2023 13:01:18 +0000 Message-ID: <20231130130118.14367-1-yangxingui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemd100001.china.huawei.com (7.185.36.94) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 05:04:22 -0800 (PST) Currently, after all recovery actions in sas_eh_handle_sas_errors() fail for sas disk, we just clear all IO, but the disk is still online. Perhaps we should continue the subsequent recovery process for IO that cannot be processed. If it still fails, the disk will be offline in scsi_eh_ready_devs(). Signed-off-by: Xingui Yang Signed-off-by: Bo Wu --- drivers/scsi/libsas/sas_scsi_host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 9047cfcd1072..3f9b99fa1769 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -637,8 +637,8 @@ static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head * SAS_ADDR(task->dev->sas_addr), cmd->device->lun); - sas_eh_finish_cmd(cmd); - goto clear_q; + list_move_tail(&cmd->eh_entry, work_q); + goto out; } } out: -- 2.17.1