lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20231201025717.16264-1-yangxingui@huawei.com>
Date:   Fri, 1 Dec 2023 02:57:17 +0000
From:   Xingui Yang <yangxingui@...wei.com>
To:     <john.g.garry@...cle.com>, <yanaijie@...wei.com>,
        <damien.lemoal@...nsource.wdc.com>
CC:     <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <wubo40@...wei.com>, <kangfenglong@...wei.com>
Subject: [PATCH v2] scsi: libsas: Put the disk offline if all recovery actions fail

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 free sas_task and 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 <yangxingui@...wei.com>
Signed-off-by: Bo Wu <wubo40@...wei.com>
---
v1 -> v2:
1. Free the sas_task of the work_q.
---
 drivers/scsi/libsas/sas_scsi_host.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 9047cfcd1072..0cd3b92a299f 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 free_q_task;
 		}
 	}
  out:
@@ -646,6 +646,15 @@ static void sas_eh_handle_sas_errors(struct Scsi_Host *shost, struct list_head *
 	list_splice_tail_init(&ha->eh_ata_q, work_q);
 	return;
 
+free_q_task:
+	pr_debug("--- Exit %s -- free_q_task\n", __func__);
+	list_for_each_entry_safe(cmd, n, work_q, eh_entry) {
+		struct sas_task *task = TO_SAS_TASK(cmd);
+
+		sas_end_task(cmd, task);
+	}
+	goto out;
+
  clear_q:
 	pr_debug("--- Exit %s -- clear_q\n", __func__);
 	list_for_each_entry_safe(cmd, n, work_q, eh_entry)
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ