Jens Axboe wrote:

On Tue, Aug 02 2005, Steven Scholz wrote:

[PATCH] ide: kill requests when drive is not present anymore

Signed-off-by: Steven Scholz <[EMAIL PROTECTED]>

Ok?

Change the CHANGELOG at your will.

--
Steven


--- linux-2.6.13-rc5/drivers/ide/ide-io.c       2005-06-17 21:48:29.000000000 
+0200
+++ linux-2.6.13-rc4-at91-multiIO/drivers/ide/ide-io.c  2005-08-02 
15:46:53.000000000 +0200
@@ -1230,7 +1257,17 @@ void do_ide_request(request_queue_t *q)
{
        ide_drive_t *drive = q->queuedata;

-       ide_do_request(HWGROUP(drive), IDE_NO_IRQ);
+       if (drive->present)
+               ide_do_request(HWGROUP(drive), IDE_NO_IRQ);
+       else {
+               struct request  *rq;
+               printk(KERN_WARNING "%s: not present, killing requests\n", 
drive->name);
+               while ((rq = elv_next_request(q)) != NULL) {
+                       blkdev_dequeue_request(rq);
+                       end_that_request_first(rq, 0, rq->hard_nr_sectors);
+                       end_that_request_last(rq);
+               }
+       }
}

/*


Looks good to me now, that's one item off Barts list :-)

Will it get into 2.6.13? It's not in -rc6 though.

--
Steven





--
Steven Scholz

imc Measurement & Control               imc Meßsysteme GmbH
Voltastr. 5                             Voltastr. 5
13355 Berlin                            13355 Berlin
Germany                                 Deutschland
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to