]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Request queue micropatch
authorJonathan Corbet <corbet@lwn.net>
Sun, 23 Mar 2003 17:24:21 +0000 (09:24 -0800)
committerDave Jones <davej@tetrachloride.(none)>
Sun, 23 Mar 2003 17:24:21 +0000 (09:24 -0800)
FYI, I have gotten some most strange results with the equivalent of:

     request_queue_t *q = kmalloc(...);
     blk_init_queue(q, ...)

The problem turns out to be that q->backing_dev_info.memory_backed is not
initialized, leaving it to be whatever was there before.  The end result is
that my "driver" never saw write requests, but reads came through fine.
Took a while to figure out that one...

Here's the fix, for what it's worth.  (I had, BTW, tried just zeroing the
whole structure in blk_init_queue(), but that makes IDE oops at boot - it
sets q->queuedata early).

drivers/block/ll_rw_blk.c

index 221ef195885c04eb34901a214d709f50040426e0..fb68973cb427417f7afae1b86d41bc76980f0f8c 100644 (file)
@@ -201,6 +201,7 @@ void blk_queue_make_request(request_queue_t * q, make_request_fn * mfn)
        q->make_request_fn = mfn;
        q->backing_dev_info.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
        q->backing_dev_info.state = 0;
+       q->backing_dev_info.memory_backed = 0;
        blk_queue_max_sectors(q, MAX_SECTORS);
        blk_queue_hardsect_size(q, 512);
        blk_queue_dma_alignment(q, 511);