]> git.baikalelectronics.ru Git - kernel.git/commit
[BLOCK] elevator init fixes
authorZachary Amsden <zach@vmware.com>
Wed, 9 Nov 2005 12:23:01 +0000 (13:23 +0100)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Sat, 12 Nov 2005 09:54:48 +0000 (10:54 +0100)
commit50fb32ef6c33384806b70404eaea9d91ab50a5b9
treeedbe103c6c5c2fe971ee270d8b0e3ae7dab8af83
parent65341b67f3454aab7758277a96e2f0afdd2b5660
[BLOCK] elevator init fixes

I got a panic in the elevator code, backtrace :

Unable to handle kernel NULL pointer dereference at virtual address 00000060
..
EIP is at elevator_put+0x0/0x30 (null elevator_type passed)
..
elevator_init+0x38
blk_init_queu_node+0xc9
floppy_init+0xdb
do_initcalls+0x23
init+0x10a
init+0x0

Clearly if the kmalloc here fails, e->elevator_type is not yet set; this
appears to be the correct fix, but I think I probably hit the second case
due to a race condition.  Someone more familiar with the elevator code
should look at this more closely until I can determine if I can reproduce.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jens Axboe <axboe@suse.de>
block/elevator.c