[linux-lvm] Resizing snapshots leaks vmalloc memory

Heinz J . Mauelshagen mauelshagen at sistina.com
Thu Mar 14 13:01:02 UTC 2002


Dale,

thanks for pointing this out.

Have changed it in CVS and will forward it to Marcelo with the next patches.

On Thu, Mar 14, 2002 at 09:17:52AM -0800, Stephenson, Dale wrote:
> When repeatedly resizing snapshots (both reducing and enlarging), I
> eventually would get VMALLOC failures.  Looking at the code, it looks like
> when snapshots are resized the old exception table and hash table are never
> freed.  A patch to address the problem follows.
> 
> Dale Stephenson
> steph at snapserver.com
> 
> --- linux/drivers/md/lvm.c.orig	Thu Mar 14 08:21:16 2002
> +++ linux/drivers/md/lvm.c	Thu Mar 14 08:23:07 2002
> @@ -2489,6 +2489,8 @@
>  		memcpy(new_lv->lv_block_exception,
>  		       old_lv->lv_block_exception, size);
>  
> +		vfree(old_lv->lv_block_exception);
> +		vfree(old_lv->lv_snapshot_hash_table);
>  		old_lv->lv_remap_end = new_lv->lv_remap_end;
>  		old_lv->lv_block_exception = new_lv->lv_block_exception;
>  		old_lv->lv_snapshot_hash_table =
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://www.sistina.com/lvm/Pages/howto.html

-- 

Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
Mauelshagen at Sistina.com                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




More information about the linux-lvm mailing list