Commit:     1ffb96c587fa2af0d690dc3548a4a781c477bfb7
Parent:     f772b3d9ca135087a70406d8466e57d1cf29237e
Author:     Thibaut VARENE <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 15 12:59:19 2007 +0100
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Tue Mar 27 08:53:04 2007 +0200

    make elv_register() output atomic
    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.
    Signed-off-by: Thibaut VARENE <[EMAIL PROTECTED]>
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
 block/elevator.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

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 = "";
        list_add_tail(&e->list, &elv_list);
-       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, 
        return 0;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to