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

[linux-lvm] Resizing snapshots leaks vmalloc memory



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 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 =



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