Patchwork ide: Must hold queue lock when requeueing

login
register
mail settings
Submitter Herbert Xu
Date March 31, 2010, 6:20 a.m.
Message ID <20100331062029.GA11559@gondor.apana.org.au>
Download mbox | patch
Permalink /patch/49084/
State Superseded
Delegated to: David Miller
Headers show

Comments

Herbert Xu - March 31, 2010, 6:20 a.m.
ide: Must hold queue lock when requeueing

ide-atapi requeues requests without holding the queue lock.
This patch fixes it by using the new ide_requeue_request function.
 
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


Cheers,
Tejun Heo - April 1, 2010, 3:06 a.m.
On 03/31/2010 03:20 PM, Herbert Xu wrote:
> ide: Must hold queue lock when requeueing
> 
> ide-atapi requeues requests without holding the queue lock.
> This patch fixes it by using the new ide_requeue_request function.
>  
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
> index eb2181a..12e9d7c 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_request(drive, failed_rq);

Nice catch but I think it would be better to call
ide_requeue_and_plug() instead of adding ide_requeue_request().

Thanks.

Patch

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index eb2181a..12e9d7c 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_request(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));