]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.13-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Jul 2021 12:39:38 +0000 (14:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Jul 2021 12:39:38 +0000 (14:39 +0200)
added patches:
mm-page_alloc-correct-return-value-of-populated-elements-if-bulk-array-is-populated.patch

queue-5.13/mm-page_alloc-correct-return-value-of-populated-elements-if-bulk-array-is-populated.patch [new file with mode: 0644]
queue-5.13/series

diff --git a/queue-5.13/mm-page_alloc-correct-return-value-of-populated-elements-if-bulk-array-is-populated.patch b/queue-5.13/mm-page_alloc-correct-return-value-of-populated-elements-if-bulk-array-is-populated.patch
new file mode 100644 (file)
index 0000000..23c52f6
--- /dev/null
@@ -0,0 +1,49 @@
+From ff4b2b4014cbffb3d32b22629252f4dc8616b0fe Mon Sep 17 00:00:00 2001
+From: Mel Gorman <mgorman@techsingularity.net>
+Date: Mon, 28 Jun 2021 19:33:29 -0700
+Subject: mm/page_alloc: correct return value of populated elements if bulk array is populated
+
+From: Mel Gorman <mgorman@techsingularity.net>
+
+commit ff4b2b4014cbffb3d32b22629252f4dc8616b0fe upstream.
+
+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/20210628150219.GC3840@techsingularity.net
+Fixes: b3b64ebd3822 ("mm/page_alloc: do bulk array bounds check after checking populated elements")
+Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
+Reported-by: Dave Jones <davej@codemonkey.org.uk>
+Tested-by: Dave Jones <davej@codemonkey.org.uk>
+Cc: Dan Carpenter <dan.carpenter@oracle.com>
+Cc: Jesper Dangaard Brouer <brouer@redhat.com>
+Cc: Vlastimil Babka <vbabka@suse.cz>
+Cc: <stable@vger.kernel.org> [5.13+]
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/page_alloc.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -5058,7 +5058,7 @@ unsigned long __alloc_pages_bulk(gfp_t g
+       /* 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)
index 0e72ba3e34eaad036c0bf8a7bcf1502164de2797..c05a3e6e9ea2471d4ec5610905a84f51b204eb8f 100644 (file)
@@ -1 +1,2 @@
 revert-kvm-x86-mmu-drop-kvm_mmu_extended_role.cr4_la57-hack.patch
+mm-page_alloc-correct-return-value-of-populated-elements-if-bulk-array-is-populated.patch