]> sourceware.org Git - lvm2.git/commitdiff
Valgrind updates
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 30 Mar 2011 12:43:32 +0000 (12:43 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 30 Mar 2011 12:43:32 +0000 (12:43 +0000)
Avoid locking sum testing with valgrind compilation.

Make memory unaccessible in the valgrind for dm_pool_abadon_object.

Valgrind hinting should not be needed in _free_chunk for dm_free.

WHATS_NEW
lib/mm/memlock.c
libdm/mm/pool-fast.c

index 2595bfe3dbc166698d0f35c2ffc0179a9565ebcc..f118a621515332350f293ed7f0a2328c4899f14e 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.85 - 
 ===================================
+  Enhance usability with the valgrind memcheck tool.
   Support regular quit of the lvm_thread_fn function in clvmd.
   Fix reading of unallocated memory in lvm1 format import function.
   Replace several strncmp() calls with id_equal().
index 3e472bda88e3d0eb070fd6aab914108b45a8eaf9..1dd0172dc109e602723970ef2fce46deccf84274 100644 (file)
@@ -195,6 +195,14 @@ static int _maps_line(const struct config_node *cn, lvmlock_t lock,
                }
        }
 
+#ifdef VALGRIND_POOL
+       /*
+        * Valgrind is continually eating memory while executing code
+        * so we need to deactivate check of locked memory size
+         */
+       sz -= sz; /* = 0, but avoids getting warning about dead assigment */
+
+#endif
        *mstats += sz;
        log_debug("%s %10ldKiB %12lx - %12lx %c%c%c%c%s",
                  (lock == LVM_MLOCK) ? "mlock" : "munlock",
index 377ad99cad3812060e278487727f9238adc7d6cc..b651449f8fc06bc4b186f313d8ed9fe905ce9d98 100644 (file)
@@ -238,6 +238,9 @@ void *dm_pool_end_object(struct dm_pool *p)
 
 void dm_pool_abandon_object(struct dm_pool *p)
 {
+#ifdef VALGRIND_POOL
+       VALGRIND_MAKE_MEM_NOACCESS(p->chunk, p->object_len);
+#endif
        p->object_len = 0;
        p->object_alignment = DEFAULT_ALIGNMENT;
 }
@@ -278,11 +281,5 @@ static struct chunk *_new_chunk(struct dm_pool *p, size_t s)
 
 static void _free_chunk(struct chunk *c)
 {
-       if (c) {
-#ifdef VALGRIND_POOL
-               VALGRIND_MAKE_MEM_UNDEFINED(c, c->end - (char *) c);
-#endif
-
-               dm_free(c);
-       }
+       dm_free(c);
 }
This page took 0.041228 seconds and 5 git commands to generate.