]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/hugetlb: fix missing call to restore_reserve_on_error()
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 16 Aug 2022 13:05:50 +0000 (21:05 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 17 Aug 2022 20:58:37 +0000 (13:58 -0700)
commitf00115abed904efaa1f7d9a02297171cf928ac65
treede4b75583ce8a8e98ffc90761f1914ad058d0de6
parentfefe3906b27618571d6cc06b2303adccb1ec5bc1
mm/hugetlb: fix missing call to restore_reserve_on_error()

When huge_add_to_page_cache() fails, the page is freed directly without
calling restore_reserve_on_error() to restore reserve for newly allocated
pages not in page cache.  Fix this by calling restore_reserve_on_error()
when huge_add_to_page_cache fails.

Link: https://lkml.kernel.org/r/20220816130553.31406-4-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb.c