Re: [PATCH] ide: fix memory leak when flush command is issued

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 16 July 2009 18:32:52 Maxime Bizon wrote:
> 
> 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@xxxxxxxxxx>

Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>

Thanks for fixing this!

> 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);
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux