Re: block completion races

Jens Axboe
2002-01-16T07:10:20Z

On Tue, Jan 15 2002, Andre Hedrick wrote:
>
> We have a more interesting problem!
> This does not show up in 2.5.1 which is patch base for 2.5.3-pre1.
> It does show up in 2.5.2-pre10 but I have not walked the patch through
> 2.5.2preX series.
>
> We have a very bad queue race that is PIO specific but really the whole
> darn driver before the patch was applied. ACB only tighten the driver's
> alignment to the NCITS standards. One should note the direct access via
> the ioctl does not lock the driver. Only coming down from BLOCK will this
> event occur.
>
> Repeatable test "hdparm -d0 -t /dev/hdx"
>
> If you apply the acb-io patch to 2.5.1 this does not happen.
>
> In the introduction of BIO, there were no "q->queue_lock" applied to
> protecting the queue.
>
> /*
> * Is meant to protect the queue in the future instead of
> * io_request_lock
> */
> spinlock_t queue_lock;
>
> Well we pulled "io_request_lock" but did we forgot to insert or add
> q->queue_lock spinlocks?
>
> It is going to be a LONG LONG NIGHT :-(

ide_lock == q->queue_lock

ide-probe.c:ide_init_queue(): blk_init_queue(q, do_ide_request, &ide_lock);

--
Jens Axboe