[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210709102855.55058-1-yanfei.xu@windriver.com>
Date: Fri, 9 Jul 2021 18:28:54 +0800
From: Yanfei Xu <yanfei.xu@...driver.com>
To: akpm@...ux-foundation.org, mgorman@...hsingularity.net
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] 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.
Signed-off-by: Yanfei Xu <yanfei.xu@...driver.com>
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d6e94cc8066c..e9fd57ca4c1c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5254,7 +5254,7 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid,
gfp &= gfp_allowed_mask;
alloc_gfp = gfp;
if (!prepare_alloc_pages(gfp, 0, preferred_nid, nodemask, &ac, &alloc_gfp, &alloc_flags))
- return 0;
+ return nr_populated;
gfp = alloc_gfp;
/* Find an allowed local zone that meets the low watermark. */
--
2.27.0
Powered by blists - more mailing lists