Re: [PATCH linux-2.6-block:master] block: fix try_module_get race in elevator_find

From: Jens Axboe
Date: Mon Aug 01 2005 - 08:16:46 EST


On Tue, Jul 26 2005, Tejun Heo wrote:
> Hello, Jens.
>
> This patch removes try_module_get race in elevator_find.
> try_module_get should always be called with the spinlock protecting
> what the module init/cleanup routines register/unregister to held. In
> the case of elevators, we should be holding elv_list to avoid it going
> away between spin_unlock_irq and try_module_get.
>
> This currently doesn't cause any problem as elevators are never
> unloaded, but the fix is simple and it's always nice to be correct.

Looks good. Elevators _are_ unloaded, right now you just can't unload as
and cfq because they use io contexts. But that will happen in the future
as well.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/