aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMel Gorman <[email protected]>2021-06-28 19:33:29 -0700
committerLinus Torvalds <[email protected]>2021-06-29 10:53:45 -0700
commitff4b2b4014cbffb3d32b22629252f4dc8616b0fe (patch)
treec20216fe121b1aecb4ca632eeec5cf415b11e7c0
parent122e093c1734361dedb64f65c99b93e28e4624f4 (diff)
mm/page_alloc: correct return value of populated elements if bulk array is populated
Dave Jones reported the following This made it into 5.13 final, and completely breaks NFSD for me (Serving tcp v3 mounts). Existing mounts on clients hang, as do new mounts from new clients. Rebooting the server back to rc7 everything recovers. The commit b3b64ebd3822 ("mm/page_alloc: do bulk array bounds check after checking populated elements") returns the wrong value if the array is already populated which is interpreted as an allocation failure. Dave reported this fixes his problem and it also passed a test running dbench over NFS. Link: https://lkml.kernel.org/r/[email protected] Fixes: b3b64ebd3822 ("mm/page_alloc: do bulk array bounds check after checking populated elements") Signed-off-by: Mel Gorman <[email protected]> Reported-by: Dave Jones <[email protected]> Tested-by: Dave Jones <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: Jesper Dangaard Brouer <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: <[email protected]> [5.13+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/page_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5b5c9f5813b9..2bf03c76504b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5058,7 +5058,7 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid,
/* Already populated array? */
if (unlikely(page_array && nr_pages - nr_populated == 0))
- return 0;
+ return nr_populated;
/* Use the single page allocator for one page. */
if (nr_pages - nr_populated == 1)