Skip to content

Commit

Permalink
mm/hugetlb: add missing annotation for gather_surplus_pages()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
irenge authored and torvalds committed Apr 7, 2020
1 parent 77337ed commit 1b2a1e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1b2a1e7

Please sign in to comment.