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 28f8263..8d1193a 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