All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Andrew Morton <akpm@osdl.org>
Cc: Miquel van Smoorenburg <miquels@cistron.nl>,
	linux-lvm@sistina.com, linux-kernel@vger.kernel.org,
	Nick Piggin <piggin@cyberone.com.au>, Jens Axboe <axboe@suse.de>
Subject: [linux-lvm] Re: System hangs after echo value > /sys/block/dm-0/queue/nr_requests
Date: Thu Jan  1 11:29:05 2004	[thread overview]
Message-ID: <3FF21BE1.9070603@cs.wisc.edu> (raw)
In-Reply-To: <20031230034239.27950054.akpm@osdl.org>

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

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

[-- Attachment #2: queue_attr.patch --]
[-- Type: text/plain, Size: 573 bytes --]

--- 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);

WARNING: multiple messages have this Message-ID (diff)
From: Mike Christie <michaelc@cs.wisc.edu>
To: Andrew Morton <akpm@osdl.org>
Cc: Miquel van Smoorenburg <miquels@cistron.nl>,
	linux-lvm@sistina.com, linux-kernel@vger.kernel.org,
	Nick Piggin <piggin@cyberone.com.au>, Jens Axboe <axboe@suse.de>
Subject: Re: System hangs after echo value > /sys/block/dm-0/queue/nr_requests
Date: Tue, 30 Dec 2003 16:44:17 -0800	[thread overview]
Message-ID: <3FF21BE1.9070603@cs.wisc.edu> (raw)
In-Reply-To: <20031230034239.27950054.akpm@osdl.org>

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

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

[-- Attachment #2: queue_attr.patch --]
[-- Type: text/plain, Size: 573 bytes --]

--- 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);

  reply	other threads:[~2004-01-01 11:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-29 13:00 System hangs after echo value > /sys/block/dm-0/queue/nr_requests Miquel van Smoorenburg
2003-12-30  9:32 ` [linux-lvm] " Andrew Morton
2003-12-30 11:42   ` Andrew Morton
2003-12-31  0:44   ` Mike Christie [this message]
2004-01-01 11:29     ` [linux-lvm] " Mike Christie
2003-12-31 10:32     ` Jens Axboe
2004-01-01 11:29       ` [linux-lvm] " Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FF21BE1.9070603@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-lvm@sistina.com \
    --cc=miquels@cistron.nl \
    --cc=piggin@cyberone.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.