diff options
author | Maxime Bizon <mbizon@freebox.fr> | 2009-07-16 02:32:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-21 23:23:46 -0400 |
commit | bc146d23d1358af43f03793c3ad8c9f16bbcffcb (patch) | |
tree | 0cf3c27204af9c991476a0ce5c0911d8c03c1b35 /drivers/ide/ide-disk.c | |
parent | 3503e0acbfab0dbcd24ccadd5fe841f3f8290e81 (diff) |
ide: fix memory leak when flush command is issued
I'm using ide on 2.6.30.1 with xfs filesystem. I noticed a kernel memory
leak after writing lots of data, the kmalloc-96 slab cache keeps
growing. It seems the struct ide_cmd kmalloced by idedisk_prepare_flush
is never kfreed.
Commit a09485df9cda49fbde2766c86eb18a9cae585162 ("ide: move request
type specific code from ide_end_drive_cmd() to callers (v3)") and
f505d49ffd25ed062e76ffd17568d3937fcd338c ("ide: fix barriers support")
cause this regression, cmd->rq must now be set for ide_complete_cmd to
honor the IDE_TFLAG_DYN flag.
Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r-- | drivers/ide/ide-disk.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 695181120cdb..7f878017b736 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -455,6 +455,7 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq) | |||
455 | 455 | ||
456 | rq->cmd_type = REQ_TYPE_ATA_TASKFILE; | 456 | rq->cmd_type = REQ_TYPE_ATA_TASKFILE; |
457 | rq->special = cmd; | 457 | rq->special = cmd; |
458 | cmd->rq = rq; | ||
458 | } | 459 | } |
459 | 460 | ||
460 | ide_devset_get(multcount, mult_count); | 461 | ide_devset_get(multcount, mult_count); |