On Tue, May 13, 2003 at 08:11:55PM +0200, Jens Axboe wrote:
> > >
> > > /* For now we assume we have the device to ourselves */
> > > /* Just a quick sanity check */
> > > - if (!blk_queue_empty(bdev_get_queue(dump_bdev->bdev))) {
> > > + if (elv_next_request(bdev_get_queue(dump_bdev->bdev))) {
> > > /* i/o in flight - safer to quit */
> > > return -EBUSY;
> > > }
>
> this looks horribly racy (of the io scheduler internals corrupting
> kind), I don't see you holding the queue lock here. some io schedulers
> do non-significant amount of work inside they next_request functions,
> moving from back-end lists to dispatch queue.
>
Jens,
All we want to do here is to check if there are requests in the
queue. Hence thinking of using elv_queue_empty(). Do you think
we still need to acquire queue lock for this ? This code will be
run when we have stopped everything else in other cpus by putting
them into spin.
--- 2569+mjb1/drivers/dump/dump_blockdev.c.orig Wed May 14 13:23:36 2003
+++ 2569+mjb1/drivers/dump/dump_blockdev.c Wed May 14 13:24:58 2003
@@ -258,10 +258,11 @@
dump_block_silence(struct dump_dev *dev)
{
struct dump_blockdev *dump_bdev = DUMP_BDEV(dev);
+ struct request_queue *q = bdev_get_queue(dump_bdev->bdev);
/* For now we assume we have the device to ourselves */
/* Just a quick sanity check */
- if (!blk_queue_empty(bdev_get_queue(dump_bdev->bdev))) {
+ if (!elv_queue_empty(q)) {
/* i/o in flight - safer to quit */
return -EBUSY;
}
Regards,
Bharata.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:50 EST