smalloc: remember to account for sizeof block header
authorJens Axboe <jens.axboe@oracle.com>
Wed, 16 Apr 2008 17:47:21 +0000 (19:47 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 16 Apr 2008 17:47:21 +0000 (19:47 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
smalloc.c

index 28f82633b23661c9e49f80612ac2c6d550c4fa8e..8d1193ab9f57e32aa5bb29431a760162116b2ca8 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -231,6 +231,7 @@ static int add_pool(struct pool *pool, unsigned int alloc_size)
        if (fd < 0)
                goto out_close;
 
+       alloc_size += sizeof(*hdr);
        if (alloc_size > smalloc_pool_size)
                pool->size = alloc_size;
        else