From: Liu Shixin liushixin2@huawei.com
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 liushixin2@huawei.com Reviewed-by: Nanyong Sun sunnanyong@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Yongqiang Liu liuyongqiang13@huawei.com --- 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;