Commit 91eaf2c2 authored by ethanwu's avatar ethanwu Committed by ZhangPeng
Browse files

ceph: fix incorrect kmalloc size of pagevec mempool

stable inclusion
from stable-v6.6.44
commit da0a3ebf9a96f0c8d60c8278e792228432435147
bugzilla: https://gitee.com/openeuler/kernel/issues/IAHMJO

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=da0a3ebf9a96f0c8d60c8278e792228432435147



--------------------------------

[ Upstream commit 03230edb0bd831662a7c08b6fef66b2a9a817774 ]

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: a0102bda ("ceph: move sb->wb_pagevec_pool to be a global mempool")
Signed-off-by: default avatarethanwu <ethanwu@synology.com>
Reviewed-by: default avatarXiubo Li <xiubli@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
parent 1a64aec2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -958,7 +958,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;