Skip to content

Commit 7fc2513

Browse files
Dan Carpentertorvalds
authored andcommitted
hugetlb: fix an error code in hugetlb_reserve_pages()
Preserve the error code from region_add() instead of returning success. Link: https://lkml.kernel.org/r/X9NGZWnZl5/Mt99R@mwanda Fixes: 0db9d74 ("hugetlb: disable region_add file_region coalescing") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com> Reviewed-by: David Hildenbrand <david@redhat.com> Cc: Mina Almasry <almasrymina@google.com> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 39a0fea commit 7fc2513

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mm/hugetlb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,6 +5113,7 @@ int hugetlb_reserve_pages(struct inode *inode,
51135113

51145114
if (unlikely(add < 0)) {
51155115
hugetlb_acct_memory(h, -gbl_reserve);
5116+
ret = add;
51165117
goto out_put_pages;
51175118
} else if (unlikely(chg > add)) {
51185119
/*

0 commit comments

Comments
 (0)