]> sourceware.org Git - dm.git/commitdiff
reorder bounds check code
authorAlasdair Kergon <agk@redhat.com>
Fri, 18 Aug 2006 21:38:58 +0000 (21:38 +0000)
committerAlasdair Kergon <agk@redhat.com>
Fri, 18 Aug 2006 21:38:58 +0000 (21:38 +0000)
WHATS_NEW
lib/mm/dbg_malloc.c

index 8b94a5a9c6201da361268ec3a4b69c0b957d9655..135a8764d3899e015f84878a5905a0f82f92696f 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 1.02.10 - 
 ==============================
+  Reorder mm bounds_check code to reduce window for a dmeventd race.
 
 Version 1.02.09 - 15 Aug 2006
 ==============================
index 348644448fdc4391e7d0bffee1b728ac759621d3..48fd43dc6b1338cee8185b0601c52d00193924b4 100644 (file)
@@ -77,15 +77,6 @@ void *dm_malloc_aux_debug(size_t s, const char *file, int line)
        nb->length = s;
        nb->id = ++_mem_stats.block_serialno;
        nb->next = 0;
-       nb->prev = _tail;
-
-       /* link to tail of the list */
-       if (!_head)
-               _head = _tail = nb;
-       else {
-               _tail->next = nb;
-               _tail = nb;
-       }
 
        /* stomp a pretty pattern across the new memory
           and fill in the boundary bytes */
@@ -99,6 +90,16 @@ void *dm_malloc_aux_debug(size_t s, const char *file, int line)
                        *ptr++ = (char) nb->id;
        }
 
+       nb->prev = _tail;
+
+       /* link to tail of the list */
+       if (!_head)
+               _head = _tail = nb;
+       else {
+               _tail->next = nb;
+               _tail = nb;
+       }
+
        _mem_stats.blocks_allocated++;
        if (_mem_stats.blocks_allocated > _mem_stats.blocks_max)
                _mem_stats.blocks_max = _mem_stats.blocks_allocated;
This page took 0.051062 seconds and 5 git commands to generate.