summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUladzislau Rezki (Sony) <urezki@gmail.com>2021-03-30 22:10:05 -0700
committerStephen Rothwell <sfr@canb.auug.org.au>2021-03-31 19:24:22 +1100
commitb7cb754d63da0029f1414368c4d7dd46db58a2b0 (patch)
tree818e33a2b1ffe189e22684ba43083b2b331b1994
parentdd9d23e1954ab6c69cacb8aa69d7125bc45cd0e1 (diff)
downloadlinux-b7cb754d63da0029f1414368c4d7dd46db58a2b0.tar.gz
linux-b7cb754d63da0029f1414368c4d7dd46db58a2b0.tar.xz
mm/vmalloc: print correct vmalloc allocation size
On entry the area->nr_pages is not set yet and is zero, thus when an allocation of the page-table array fails the vmalloc size will not be reflected correctly in a error message. Replace area->nr_pages by the nr_small_pages. Link: https://lkml.kernel.org/r/20210329193214.GA28602@pc638.lan Fixes: 014ccf9b888d ("mm/vmalloc: improve allocation failure error messages") Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com> Reported-by: Colin King <colin.king@canonical.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--mm/vmalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index eafad06b826a..eaf8e1b58a34 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2793,7 +2793,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
warn_alloc(gfp_mask, NULL,
"vmalloc size %lu allocation failure: "
"page array size %lu allocation failed",
- area->nr_pages * PAGE_SIZE, array_size);
+ nr_small_pages * PAGE_SIZE, array_size);
return NULL;
}