[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[linux-lvm] Re: 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);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]