* [PATCH] block layer: elv_iosched_show should get elv_list_lock
@ 2006-10-11 11:19 Vasily Tarasov
2006-10-11 11:23 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Vasily Tarasov @ 2006-10-11 11:19 UTC (permalink / raw)
To: Jens Axboe; +Cc: Linux Kernel Mailing List, OpenVZ Developer List
elv_iosched_show function iterates other elv_list,
hence elv_list_lock should be got.
Also the question is: in elv_iosched_show, elv_iosched_store
q->elevator->elevator_type construction is used without locking q->queue_lock.
Is it expected?..
Signed-off-by: Vasily Tarasov <vtaras@openvz.org>
--
--- linux-2.6.18/block/elevator.c.orig 2006-10-11 11:00:34.000000000 +0400
+++ linux-2.6.18/block/elevator.c 2006-10-11 15:08:20.000000000 +0400
@@ -892,7 +892,7 @@ ssize_t elv_iosched_show(request_queue_t
struct list_head *entry;
int len = 0;
- spin_lock_irq(q->queue_lock);
+ spin_lock_irq(&elv_list_lock);
list_for_each(entry, &elv_list) {
struct elevator_type *__e;
@@ -902,7 +902,7 @@ ssize_t elv_iosched_show(request_queue_t
else
len += sprintf(name+len, "%s ", __e->elevator_name);
}
- spin_unlock_irq(q->queue_lock);
+ spin_unlock_irq(&elv_list_lock);
len += sprintf(len+name, "\n");
return len;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] block layer: elv_iosched_show should get elv_list_lock
2006-10-11 11:19 [PATCH] block layer: elv_iosched_show should get elv_list_lock Vasily Tarasov
@ 2006-10-11 11:23 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2006-10-11 11:23 UTC (permalink / raw)
To: Vasily Tarasov; +Cc: Linux Kernel Mailing List, OpenVZ Developer List
On Wed, Oct 11 2006, Vasily Tarasov wrote:
> elv_iosched_show function iterates other elv_list,
> hence elv_list_lock should be got.
Indeed, that's a bug. Thanks!
> Also the question is: in elv_iosched_show, elv_iosched_store
> q->elevator->elevator_type construction is used without locking
> q->queue_lock. Is it expected?..
As long as the queue doesn't go away, we should be safe enough.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-11 11:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-11 11:19 [PATCH] block layer: elv_iosched_show should get elv_list_lock Vasily Tarasov
2006-10-11 11:23 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox