Patchwork v2: ide: Must hold queue lock when requeueing

login
register
mail settings
Submitter Herbert Xu
Date April 1, 2010, 6:13 a.m.
Message ID <20100401061339.GA21145@gondor.apana.org.au>
Download mbox | patch
Permalink /patch/49188/
State Accepted
Delegated to: David Miller
Headers show

Comments

Herbert Xu - April 1, 2010, 6:13 a.m.
On Thu, Apr 01, 2010 at 02:11:59PM +0800, Herbert Xu wrote:
> 
> OK, here are the two patches again using ide_requeue_and_plug.

ide: Must hold queue lock when requeueing

ide-atapi requeues requests without holding the queue lock.
This patch fixes it by using ide_requeue_and_plug.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


Cheers,
David Miller - April 1, 2010, 8:31 a.m.
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 1 Apr 2010 14:13:39 +0800

> On Thu, Apr 01, 2010 at 02:11:59PM +0800, Herbert Xu wrote:
>> 
>> OK, here are the two patches again using ide_requeue_and_plug.
> 
> ide: Must hold queue lock when requeueing

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index eb2181a..9aedb9a 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -263,8 +263,8 @@  void ide_retry_pc(ide_drive_t *drive)
 	 * of it.  The failed command will be retried after sense data
 	 * is acquired.
 	 */
-	blk_requeue_request(failed_rq->q, failed_rq);
 	drive->hwif->rq = NULL;
+	ide_requeue_and_plug(drive, failed_rq);
 	if (ide_queue_sense_rq(drive, pc)) {
 		blk_start_request(failed_rq);
 		ide_complete_rq(drive, -EIO, blk_rq_bytes(failed_rq));