lkml.org 
[lkml]   [2003]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: System hangs after echo value > /sys/block/dm-0/queue/nr_requests
Andrew Morton wrote:

> Where queue_requests_store() does wake_up(&rl->wait[READ]);
>
> It looks like nobody has called blk_init_queue() for this queue and the
> waitqueue head is uninitialised.
>

DM, MD, rd and loop use blk_alloc_queue and blk_queue_make_request to
initialize their queue, because they only use the make_request_fn. The
attached patch prevents the queue from being registered if only
blk_alloc_queue was called.

Mike Christie
--- linux-2.6.0-orig/drivers/block/ll_rw_blk.c 2003-12-28 23:09:16.000000000 -0800
+++ linux-2.6.0/drivers/block/ll_rw_blk.c 2003-12-30 16:11:00.690504036 -0800
@@ -2902,7 +2902,7 @@ int blk_register_queue(struct gendisk *d

request_queue_t *q = disk->queue;

- if (!q)
+ if (!q || !q->request_fn)
return -ENXIO;

q->kobj.parent = kobject_get(&disk->kobj);
@@ -2929,7 +2929,7 @@ void blk_unregister_queue(struct gendisk
{
request_queue_t *q = disk->queue;

- if (q) {
+ if (q && q->request_fn) {
elv_unregister_queue(q);

kobject_unregister(&q->kobj);
\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.032 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site