* [linux-lvm] Snapshot resizing memory leak
@ 2003-03-03 12:28 Dale J. Stephenson
2003-03-04 6:05 ` Heinz J . Mauelshagen
0 siblings, 1 reply; 2+ messages in thread
From: Dale J. Stephenson @ 2003-03-03 12:28 UTC (permalink / raw)
To: linux-lvm
It looks like the current lvm code still has the memory leak when
resizing snapshots. The lv_block_exception and lv_snapshot_hash_table
fields are set to ones newly allocated for the new size, but the old
ones are not freed. The following patch should fix it:
--- 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 =
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-lvm] Snapshot resizing memory leak
2003-03-03 12:28 [linux-lvm] Snapshot resizing memory leak Dale J. Stephenson
@ 2003-03-04 6:05 ` Heinz J . Mauelshagen
0 siblings, 0 replies; 2+ messages in thread
From: Heinz J . Mauelshagen @ 2003-03-04 6:05 UTC (permalink / raw)
To: linux-lvm
Dale,
thanks for finding this one.
Could you please give the LVM version you patched in future posts ?
Regards,
Heinz -- The LVM Guy --
On Mon, Mar 03, 2003 at 01:28:58PM -0800, Dale J. Stephenson wrote:
> It looks like the current lvm code still has the memory leak when
> resizing snapshots. The lv_block_exception and lv_snapshot_hash_table
> fields are set to ones newly allocated for the new size, but the old
> ones are not freed. The following patch should fix it:
>
> --- 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@sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
*** 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@Sistina.com +49 2626 141200
FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-04 6:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-03 12:28 [linux-lvm] Snapshot resizing memory leak Dale J. Stephenson
2003-03-04 6:05 ` Heinz J . Mauelshagen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.