linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide: fix memory leak when flush command is issued
@ 2009-07-16 16:32 Maxime Bizon
  2009-07-17 14:05 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Bizon @ 2009-07-16 16:32 UTC (permalink / raw)
  To: davem; +Cc: linux-ide, Bartlomiej Zolnierkiewicz


Hi David, Bartlomiej

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 and
f505d49ffd25ed062e76ffd17568d3937fcd338c cause this regression, cmd->rq
must now be set for ide_complete_cmd to honor the IDE_TFLAG_DYN flag.

Candidate for stable I think, thanks !

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 6951811..7f87801 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)
 
 	rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
 	rq->special = cmd;
+	cmd->rq = rq;
 }
 
 ide_devset_get(multcount, mult_count);


-- 
Maxime



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-22  3:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-16 16:32 [PATCH] ide: fix memory leak when flush command is issued Maxime Bizon
2009-07-17 14:05 ` Bartlomiej Zolnierkiewicz
2009-07-22  3:25   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).