]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ceph: fix incorrect kmalloc size of pagevec mempool
authorethanwu <ethanwu@synology.com>
Thu, 11 Jul 2024 06:47:56 +0000 (14:47 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 23 Jul 2024 08:01:57 +0000 (10:01 +0200)
The kmalloc size of pagevec mempool is incorrectly calculated.
It misses the size of page pointer and only accounts the number for the array.

Fixes: a0102bda5bc0 ("ceph: move sb->wb_pagevec_pool to be a global mempool")
Signed-off-by: ethanwu <ethanwu@synology.com>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/super.c

index 885cb5d4e771a1eddc4865b4c87773680f46b382..0cdf84cd179128d118c7e9a0d34287c27859698d 100644 (file)
@@ -961,7 +961,8 @@ static int __init init_caches(void)
        if (!ceph_mds_request_cachep)
                goto bad_mds_req;
 
-       ceph_wb_pagevec_pool = mempool_create_kmalloc_pool(10, CEPH_MAX_WRITE_SIZE >> PAGE_SHIFT);
+       ceph_wb_pagevec_pool = mempool_create_kmalloc_pool(10,
+           (CEPH_MAX_WRITE_SIZE >> PAGE_SHIFT) * sizeof(struct page *));
        if (!ceph_wb_pagevec_pool)
                goto bad_pagevec_pool;