From: Darrick J. Wong Date: Thu, 11 Jan 2007 22:15:03 +0000 (-0800) Subject: [SCSI] libsas: Destroy the task collector thread after releasing ports X-Git-Tag: v2.6.21-rc1~274^2~230^2~82 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cde3f74bac3e4a6bcdc3a6370af38179fd8ef1f2;p=karo-tx-linux.git [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 Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index 90cce34cb6f5..4df73d69bb3c 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/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; }