aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_ata.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2010-10-01 16:55:47 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-08 17:03:42 -0400
commit56dd2c0691a5a387b7b05835fe547dc6fade9407 (patch)
treed7ff3abef5b42f554128b30072aaa1e2aa7eab08 /drivers/scsi/libsas/sas_ata.c
parent39a985547cbfcbb0b23667b69b8ae82a6cf312ac (diff)
[SCSI] libsas: Don't issue commands to devices that have been hot-removed
sd will get hung up issuing commands to flush write cache if a SAS device behind the expander is unplugged without warning. Change libsas to reject commands to domain devices that have already gone away. [maciej.trela@intel.com: removed setting ->gone in sas_deform_port() to permit sync cache commands at module removal] Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Tested-by: Haipao Fan <haipao.fan@intel.com> Signed-off-by: Maciej Trela <maciej.trela@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libsas/sas_ata.c')
-rw-r--r--drivers/scsi/libsas/sas_ata.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index ddbade7beec9..e1a395b438ee 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -162,6 +162,10 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
162 unsigned int xfer = 0; 162 unsigned int xfer = 0;
163 unsigned int si; 163 unsigned int si;
164 164
165 /* If the device fell off, no sense in issuing commands */
166 if (dev->gone)
167 return AC_ERR_SYSTEM;
168
165 task = sas_alloc_task(GFP_ATOMIC); 169 task = sas_alloc_task(GFP_ATOMIC);
166 if (!task) 170 if (!task)
167 return AC_ERR_SYSTEM; 171 return AC_ERR_SYSTEM;