[RFC] Switching block device elevators

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Oberparleiter
Date: Monday, August 16, 2010 - 7:52 am

After commit 1abec4fdbb142e3ccb6ce99832fae42129134a96, "block: make 
blk_init_free_list and elevator_init idempotent", we're seeing kernel 
panics in our s390 tape block device driver. The panic is triggered 
because our driver tries to replace the default elevator with a noop 
elevator by calling elevator_exit() directly followed by elevator_init().

Since the commit, elevator_init() returns 0 if request_queue->elevator 
is non-null, even though it does not install a new elevator. As a 
result, the next access to the elevator finds a pointer to the old one 
which was already freed and a panic is triggered. Our current fix 
consists of setting the elevator pointer to NULL after elevator_exit().

There is at least one other driver where the problem currently exists 
(drivers/block/mg_disk.c, author on cc) and another s390 driver where 
the problem was only accidentally fixed before 2.6.35. I'm wondering if 
there's a better solution (apart from not forcing an elevator) and would 
like to hear everyone's opinion on this matter. How about declaring 
elevator_switch() non-static, for example?


Regards,
   Peter Oberparleiter

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] Switching block device elevators, Peter Oberparleiter, (Mon Aug 16, 7:52 am)
Re: Switching block device elevators, Mike Snitzer, (Mon Aug 16, 8:44 am)