From 7d9032b0a196d405d9012b37b60e14f8d7bdb786 Mon Sep 17 00:00:00 2001 From: Liu Shixin Date: Thu, 16 Feb 2023 11:13:19 +0000 Subject: [PATCH] dhugetlb: set hpool to NULL for cont-bit hugepage hulk inclusion category: bugfix bugzilla: 46904, https://gitee.com/openeuler/kernel/issues/I6FCQZ CVE: NA -------------------------------- When dynamic hugetlb is enabled, the hpool should be NULL for cont-bit hugepage, set it. Fixes: f15774c66bcd ("dhugetlb: only support 1G/2M hugepage and ARM64_4K_PAGES") Signed-off-by: Liu Shixin Reviewed-by: Nanyong Sun Reviewed-by: Kefeng Wang Signed-off-by: Yongqiang Liu --- fs/hugetlbfs/inode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index d70c8aaf5acc..014ee6533e2e 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1183,6 +1183,8 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb) if (huge_page_size(sbinfo->hstate) == PMD_SIZE || huge_page_size(sbinfo->hstate) == PUD_SIZE) p->hpool = get_dhugetlb_pool_from_task(current); + else + p->hpool = NULL; #endif return &p->vfs_inode; -- GitLab