Re: [PATCH] elevator: do not request_module if elevator exists
From: Breno Leitao
Date: Fri Oct 11 2024 - 09:17:42 EST
Hello Jens,
On Fri, Oct 11, 2024 at 07:12:43AM -0600, Jens Axboe wrote:
> 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.
Sure, I will be sending soon. Sorry for not finding it earlier.