aboutsummaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
authorThibaut VARENE <T-Bone@parisc-linux.org>2007-03-15 07:59:19 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-03-27 02:53:04 -0400
commit1ffb96c587fa2af0d690dc3548a4a781c477bfb7 (patch)
treee813df1932a8f2ed55f9f5d5f35407a878620680 /block/elevator.c
parentf772b3d9ca135087a70406d8466e57d1cf29237e (diff)
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 <varenet@parisc-linux.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/elevator.c')
-rw-r--r--block/elevator.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 25f6ef28e3bb..96a00c822748 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -964,17 +964,18 @@ void elv_unregister_queue(struct request_queue *q)
964 964
965int elv_register(struct elevator_type *e) 965int elv_register(struct elevator_type *e)
966{ 966{
967 char *def = "";
967 spin_lock_irq(&elv_list_lock); 968 spin_lock_irq(&elv_list_lock);
968 BUG_ON(elevator_find(e->elevator_name)); 969 BUG_ON(elevator_find(e->elevator_name));
969 list_add_tail(&e->list, &elv_list); 970 list_add_tail(&e->list, &elv_list);
970 spin_unlock_irq(&elv_list_lock); 971 spin_unlock_irq(&elv_list_lock);
971 972
972 printk(KERN_INFO "io scheduler %s registered", e->elevator_name);
973 if (!strcmp(e->elevator_name, chosen_elevator) || 973 if (!strcmp(e->elevator_name, chosen_elevator) ||
974 (!*chosen_elevator && 974 (!*chosen_elevator &&
975 !strcmp(e->elevator_name, CONFIG_DEFAULT_IOSCHED))) 975 !strcmp(e->elevator_name, CONFIG_DEFAULT_IOSCHED)))
976 printk(" (default)"); 976 def = " (default)";
977 printk("\n"); 977
978 printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def);
978 return 0; 979 return 0;
979} 980}
980EXPORT_SYMBOL_GPL(elv_register); 981EXPORT_SYMBOL_GPL(elv_register);