Re: [PATCH] elevator: do not request_module if elevator exists

From: Jens Axboe
Date: Fri Oct 11 2024 - 09:13:34 EST


On 10/11/24 2:24 AM, Christoph Hellwig wrote:
>> diff --git a/block/elevator.c b/block/elevator.c
>> index 4122026b11f1..1904e217505a 100644
>> --- a/block/elevator.c
>> +++ b/block/elevator.c
>> @@ -709,13 +709,16 @@ int elv_iosched_load_module(struct gendisk *disk, const char *buf,
>> size_t count)
>> {
>> char elevator_name[ELV_NAME_MAX];
>> + const char *name;
>>
>> if (!elv_support_iosched(disk->queue))
>> return -EOPNOTSUPP;
>>
>> strscpy(elevator_name, buf, sizeof(elevator_name));
>> + name = strstrip(elevator_name);
>>
>> - request_module("%s-iosched", strstrip(elevator_name));
>> + if (!__elevator_find(name))
>
> __elevator_find needs to be called with elv_list_lock.

Doh yes. Breno, I just dropped it for now, just send a v2.

--
Jens Axboe