From: Jules Irenge Date: Tue, 7 Apr 2020 03:08:09 +0000 (-0700) Subject: mm/hugetlb: add missing annotation for gather_surplus_pages() X-Git-Tag: v5.15~4112^2~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b2a1e7bb9ce9936d6839c1023737ccff7889dee;p=platform%2Fkernel%2Flinux-starfive.git mm/hugetlb: add missing annotation for gather_surplus_pages() Sparse reports a warning at gather_surplus_pages() warning: context imbalance in hugetlb_cow() - unexpected unlock The root cause is the missing annotation at gather_surplus_pages() Add the missing __must_hold(&hugetlb_lock) Signed-off-by: Jules Irenge Signed-off-by: Andrew Morton Reviewed-by: Mike Kravetz Link: http://lkml.kernel.org/r/20200214204741.94112-7-jbi.octave@gmail.com Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f9ea1e5..f5fb53f 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2010,6 +2010,7 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, * of size 'delta'. */ static int gather_surplus_pages(struct hstate *h, int delta) + __must_hold(&hugetlb_lock) { struct list_head surplus_list; struct page *page, *tmp;