Commit bc146d23 authored by Maxime Bizon's avatar Maxime Bizon Committed by David S. Miller
Browse files

ide: fix memory leak when flush command is issued

I'm using ide on 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 a09485df ("ide: move request
type specific code from ide_end_drive_cmd() to callers (v3)") and

 ("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: default avatarMaxime Bizon <>
Acked-by: default avatarBartlomiej Zolnierkiewicz <>
Signed-off-by: default avatarDavid S. Miller <>
parent 3503e0ac
......@@ -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);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment