Skip to content

Commit e5c15ce

Browse files
Yanfei Xutorvalds
authored andcommitted
mm/page_alloc: correct return value when failing at preparing
If the array passed in is already partially populated, we should return "nr_populated" even failing at preparing arguments stage. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Yanfei Xu <[email protected]> Signed-off-by: Mel Gorman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 187ad46 commit e5c15ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/page_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5255,7 +5255,7 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid,
52555255
gfp &= gfp_allowed_mask;
52565256
alloc_gfp = gfp;
52575257
if (!prepare_alloc_pages(gfp, 0, preferred_nid, nodemask, &ac, &alloc_gfp, &alloc_flags))
5258-
return 0;
5258+
return nr_populated;
52595259
gfp = alloc_gfp;
52605260

52615261
/* Find an allowed local zone that meets the low watermark. */

0 commit comments

Comments
 (0)