aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_ata.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-04-15 09:00:08 +0900
committerJames Bottomley <James.Bottomley@suse.de>2010-05-01 14:17:19 -0500
commit70b25f890ce9f0520c64075ce9225a5b020a513e (patch)
treec97c211ee93b11c6ebed99c81979bf81773c18d2 /drivers/scsi/libsas/sas_ata.c
parent9a908c1aa4d3898f62e2cb8af6936b16503ab3e6 (diff)
downloadkernel_samsung_smdk4412-70b25f890ce9f0520c64075ce9225a5b020a513e.zip
kernel_samsung_smdk4412-70b25f890ce9f0520c64075ce9225a5b020a513e.tar.gz
kernel_samsung_smdk4412-70b25f890ce9f0520c64075ce9225a5b020a513e.tar.bz2
[SCSI] fix locking around blk_abort_request()
blk_abort_request() expects queue lock to be held by the caller. Grab it before calling the function. Lack of this synchronization led to infinite loop on corrupt q->timeout_list. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: stable@kernel.org 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 b00efd1..88f7446 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -395,11 +395,15 @@ int sas_ata_init_host_and_port(struct domain_device *found_dev,
void sas_ata_task_abort(struct sas_task *task)
{
struct ata_queued_cmd *qc = task->uldd_task;
+ struct request_queue *q = qc->scsicmd->device->request_queue;
struct completion *waiting;
+ unsigned long flags;
/* Bounce SCSI-initiated commands to the SCSI EH */
if (qc->scsicmd) {
+ spin_lock_irqsave(q->queue_lock, flags);
blk_abort_request(qc->scsicmd->request);
+ spin_unlock_irqrestore(q->queue_lock, flags);
scsi_schedule_eh(qc->scsicmd->device->host);
return;
}