Skip to content

Commit 2727cfe

Browse files
MiaoheLinakpm00
authored andcommitted
hugetlb_cgroup: fix wrong hugetlb cgroup numa stat
We forget to set cft->private for numa stat file. As a result, numa stat of hstates[0] is always showed for all hstates. Encode the hstates index into cft->private to fix this issue. Link: https://lkml.kernel.org/r/20220723073804.53035-1-linmiaohe@huawei.com Fixes: f477619 ("hugetlb: add hugetlb.*.numa_stat file") Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Acked-by: Muchun Song <songmuchun@bytedance.com> Cc: Kees Cook <keescook@chromium.org> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Mina Almasry <almasrymina@google.com> Cc: Shakeel Butt <shakeelb@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 360b420 commit 2727cfe

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mm/hugetlb_cgroup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ static void __init __hugetlb_cgroup_file_dfl_init(int idx)
772772
/* Add the numa stat file */
773773
cft = &h->cgroup_files_dfl[6];
774774
snprintf(cft->name, MAX_CFTYPE_NAME, "%s.numa_stat", buf);
775+
cft->private = MEMFILE_PRIVATE(idx, 0);
775776
cft->seq_show = hugetlb_cgroup_read_numa_stat;
776777
cft->flags = CFTYPE_NOT_ON_ROOT;
777778

0 commit comments

Comments
 (0)