* [PATCH 1/3] block cleanups: Fix iosched module refcount leak
@ 2005-09-27 22:20 Nate Diller
2005-09-27 22:40 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Nate Diller @ 2005-09-27 22:20 UTC (permalink / raw)
To: axboe, akpm; +Cc: linux-kernel
If the requested I/O scheduler is already in place, elevator_switch simply leaves the queue
alone, and returns. However, it forgets to call elevator_put, so
'echo [current_sched] > /sys/block/[dev]/queue/scheduler'
will leak a reference, causing the current_sched module to be permanently pinned in memory.
This patchset is against 2.6.14-rc2-mm1, but should apply to anything recent.
NATE
Signed-off-by: Nate Diller <nate@namesys.com>
--- a/drivers/block/elevator.c 2005-09-26 19:17:59.000000000 -0700
+++ b/drivers/block/elevator.c 2005-09-27 11:13:15.000000000 -0700
@@ -692,8 +692,10 @@ ssize_t elv_iosched_store(request_queue_
return -EINVAL;
}
- if (!strcmp(elevator_name, q->elevator->elevator_type->elevator_name))
+ if (!strcmp(elevator_name, q->elevator->elevator_type->elevator_name)) {
+ elevator_put(e);
return count;
+ }
elevator_switch(q, e);
return count;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 1/3] block cleanups: Fix iosched module refcount leak
2005-09-27 22:20 [PATCH 1/3] block cleanups: Fix iosched module refcount leak Nate Diller
@ 2005-09-27 22:40 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2005-09-27 22:40 UTC (permalink / raw)
To: Nate Diller; +Cc: akpm, linux-kernel
On Tue, Sep 27 2005, Nate Diller wrote:
> If the requested I/O scheduler is already in place, elevator_switch simply
> leaves the queue alone, and returns. However, it forgets to call
> elevator_put, so
>
> 'echo [current_sched] > /sys/block/[dev]/queue/scheduler'
>
> will leak a reference, causing the current_sched module to be permanently
> pinned in memory.
>
> This patchset is against 2.6.14-rc2-mm1, but should apply to anything
> recent.
Thanks, looks good.
Signed-off-by: Jens Axboe <axboe@suse.de>
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-27 22:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-27 22:20 [PATCH 1/3] block cleanups: Fix iosched module refcount leak Nate Diller
2005-09-27 22:40 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox