Skip to content

Commit

Permalink
ide: fix memory leak when flush command is issued
Browse files Browse the repository at this point in the history
commit bc146d2 upstream.

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 a09485d ("ide: move request
type specific code from ide_end_drive_cmd() to callers (v3)") and
f505d49 ("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>
Cc: Simon Kirby <sim@netnation.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Maxime Bizon authored and Greg Kroah-Hartman committed Aug 16, 2009
1 parent df38378 commit ff77456
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
rq->cmd_flags |= REQ_SOFTBARRIER;
rq->special = cmd;
cmd->rq = rq;
}

ide_devset_get(multcount, mult_count);
Expand Down

0 comments on commit ff77456

Please sign in to comment.