* [PATCH #upstream-fixes] libata: fix locking around blk_abort_request()
@ 2010-04-14 23:57 Tejun Heo
2010-04-23 1:52 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2010-04-14 23:57 UTC (permalink / raw)
To: Jeff Garzik, linux-ide@vger.kernel.org
blk_abort_request() expectes 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: Jens Axboe <axboe@kernel.dk>
Cc: stable@kernel.org
---
drivers/ata/libata-eh.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 9f6cfac..9e18cc9 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -879,6 +879,8 @@ static void ata_eh_set_pending(struct ata_port *ap, int fastdrain)
void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
{
struct ata_port *ap = qc->ap;
+ struct request_queue *q = qc->scsicmd->device->request_queue;
+ unsigned long flags;
WARN_ON(!ap->ops->error_handler);
@@ -890,7 +892,9 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
* Note that ATA_QCFLAG_FAILED is unconditionally set after
* this function completes.
*/
+ spin_lock_irqsave(q->queue_lock, flags);
blk_abort_request(qc->scsicmd->request);
+ spin_unlock_irqrestore(q->queue_lock, flags);
}
/**
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH #upstream-fixes] libata: fix locking around blk_abort_request()
2010-04-14 23:57 [PATCH #upstream-fixes] libata: fix locking around blk_abort_request() Tejun Heo
@ 2010-04-23 1:52 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2010-04-23 1:52 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide@vger.kernel.org
On 04/14/2010 07:57 PM, Tejun Heo wrote:
> blk_abort_request() expectes 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: Jens Axboe<axboe@kernel.dk>
> Cc: stable@kernel.org
> ---
> drivers/ata/libata-eh.c | 4 ++++
> 1 file changed, 4 insertions(+)
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-23 1:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-14 23:57 [PATCH #upstream-fixes] libata: fix locking around blk_abort_request() Tejun Heo
2010-04-23 1:52 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).