浏览代码

[SCSI] libsas: Destroy the task collector thread after releasing ports

If we use task collector mode, we can end up destroying the task collector
thread before we release the ports, which is bad if a port release causes
a disk I/O (such as cache flushing).

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Darrick J. Wong 18 年之前
父节点
当前提交
cde3f74bac
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      drivers/scsi/libsas/sas_init.c

+ 3 - 2
drivers/scsi/libsas/sas_init.c

@@ -127,12 +127,13 @@ Undo_phys:
 
 int sas_unregister_ha(struct sas_ha_struct *sas_ha)
 {
+	sas_unregister_ports(sas_ha);
+
 	if (sas_ha->lldd_max_execute_num > 1) {
 		sas_shutdown_queue(sas_ha);
+		sas_ha->lldd_max_execute_num = 1;
 	}
 
-	sas_unregister_ports(sas_ha);
-
 	return 0;
 }