* [PATCH] make elv_register() output atomic
@ 2007-03-08 13:06 Thibaut VARENE
2007-03-08 13:42 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Thibaut VARENE @ 2007-03-08 13:06 UTC (permalink / raw)
To: axboe; +Cc: linux-kernel
Hi,
Booting 2.6.21-rc3-g45592145 I noticed the following on one of my
machines in the bootlog:
io scheduler noop registered<6>Time: jiffies clocksource has been installed.
io scheduler deadline registered (default)
Looking at block/elevator.c, it appears that elv_register() uses two
consecutive printks in a non-atomic way, leading to the above glitch. The
attached trivial patch fixes this issue, by using a single printk.
HTH
T-Bone
PS: please CC-me in replies.
Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
--
Thibaut VARENE
http://www.parisc-linux.org/~varenet/
diff --git a/block/elevator.c b/block/elevator.c
index 25f6ef2..96a00c8 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -964,17 +964,18 @@ void elv_unregister_queue(struct request_queue *q)
int elv_register(struct elevator_type *e)
{
+ char *def = "";
spin_lock_irq(&elv_list_lock);
BUG_ON(elevator_find(e->elevator_name));
list_add_tail(&e->list, &elv_list);
spin_unlock_irq(&elv_list_lock);
- printk(KERN_INFO "io scheduler %s registered", e->elevator_name);
if (!strcmp(e->elevator_name, chosen_elevator) ||
(!*chosen_elevator &&
!strcmp(e->elevator_name, CONFIG_DEFAULT_IOSCHED)))
- printk(" (default)");
- printk("\n");
+ def = " (default)";
+
+ printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def);
return 0;
}
EXPORT_SYMBOL_GPL(elv_register);
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] make elv_register() output atomic
2007-03-08 13:06 [PATCH] make elv_register() output atomic Thibaut VARENE
@ 2007-03-08 13:42 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2007-03-08 13:42 UTC (permalink / raw)
To: Thibaut VARENE; +Cc: linux-kernel
On Thu, Mar 08 2007, Thibaut VARENE wrote:
> Hi,
>
> Booting 2.6.21-rc3-g45592145 I noticed the following on one of my
> machines in the bootlog:
>
> io scheduler noop registered<6>Time: jiffies clocksource has been installed.
>
> io scheduler deadline registered (default)
>
>
> Looking at block/elevator.c, it appears that elv_register() uses two
> consecutive printks in a non-atomic way, leading to the above glitch. The
> attached trivial patch fixes this issue, by using a single printk.
Thanks, looks like a good fix!
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-08 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-08 13:06 [PATCH] make elv_register() output atomic Thibaut VARENE
2007-03-08 13:42 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox