public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH zfsonlinux] debian/patches: backport vmalloc gfp flag fix
@ 2026-05-20  8:36 Christian Ebner
  2026-05-20  8:46 ` applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Ebner @ 2026-05-20  8:36 UTC (permalink / raw)
  To: pve-devel

Since commit 07003531e ("mm/vmalloc: warn on invalid vmalloc gfp
flags") [0] the Linux kernel explicitley warns and clears unsupported
gfp flags to vmalloc calls. ZFS already fixed some of these, in
particular __GFP_COMP flag in commit cb1833023 ("kmem: don't add
__GFP_COMP for KM_VMEM allocations"). This was however incomplete.

Backport the upstream fix, the otherwise shown kernel trace is
potentially alarming but benign as also confirmed by upstream [1].

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=07003531e03c864b0711757c8009c7f14c95d1d1
[1] https://github.com/openzfs/zfs/issues/18556

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 ...ove-__GFP_COMP-before-calling-vmallo.patch | 38 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 debian/patches/0011-spl_kvmalloc-remove-__GFP_COMP-before-calling-vmallo.patch

diff --git a/debian/patches/0011-spl_kvmalloc-remove-__GFP_COMP-before-calling-vmallo.patch b/debian/patches/0011-spl_kvmalloc-remove-__GFP_COMP-before-calling-vmallo.patch
new file mode 100644
index 0000000000..ebc6704cb7
--- /dev/null
+++ b/debian/patches/0011-spl_kvmalloc-remove-__GFP_COMP-before-calling-vmallo.patch
@@ -0,0 +1,38 @@
+From e5473afe18a013ec76070e8ef10597f7cda153f2 Mon Sep 17 00:00:00 2001
+From: Rob Norris <rob.norris@truenas.com>
+Date: Wed, 20 May 2026 02:11:31 +1000
+Subject: [PATCH] spl_kvmalloc: remove __GFP_COMP before calling vmalloc()
+
+In cb1833023 we stopped using it for KM_VMEM allocations, since its not
+a valid flag for vmalloc(). However, there's a fallback path for
+non-KM_VMEM allocations to use vmalloc(), and we need to remove
+__GFP_COMP there too to avoid a warning.
+
+Sponsored-by: TrueNAS
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Rob Norris <rob.norris@truenas.com>
+Closes #18558
+---
+ module/os/linux/spl/spl-kmem.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/module/os/linux/spl/spl-kmem.c b/module/os/linux/spl/spl-kmem.c
+index 9fe4042b50..6e34026198 100644
+--- a/module/os/linux/spl/spl-kmem.c
++++ b/module/os/linux/spl/spl-kmem.c
+@@ -188,6 +188,12 @@ spl_kvmalloc(size_t size, gfp_t lflags)
+ 		return (ptr);
+ 	}
+ 
++	/*
++	 * vmalloc fallback. KM_VMEM may not have been requested originally if
++	 * we've come through spl_kmem_alloc_impl(), so we need to remove
++	 * __GFP_COMP, which is not a valid flag for vmalloc.
++	 */
++	lflags &= ~__GFP_COMP;
+ 	return (spl_vmalloc(size, lflags));
+ }
+ 
+-- 
+2.47.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 0ef82e7bbd..b73cc42841 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@
 0008-zpool-status-tighten-bounds-for-noalloc-stat-availab.patch
 0009-libzfs-scrub-only-include-start-and-end-nv-pairs-if-.patch
 0010-Add-no-preserve-encryption-flag.patch
+0011-spl_kvmalloc-remove-__GFP_COMP-before-calling-vmallo.patch
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* applied: [PATCH zfsonlinux] debian/patches: backport vmalloc gfp flag fix
  2026-05-20  8:36 [PATCH zfsonlinux] debian/patches: backport vmalloc gfp flag fix Christian Ebner
@ 2026-05-20  8:46 ` Fabian Grünbichler
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2026-05-20  8:46 UTC (permalink / raw)
  To: pve-devel, Christian Ebner


On Wed, 20 May 2026 10:36:12 +0200, Christian Ebner wrote:
> Since commit 07003531e ("mm/vmalloc: warn on invalid vmalloc gfp
> flags") [0] the Linux kernel explicitley warns and clears unsupported
> gfp flags to vmalloc calls. ZFS already fixed some of these, in
> particular __GFP_COMP flag in commit cb1833023 ("kmem: don't add
> __GFP_COMP for KM_VMEM allocations"). This was however incomplete.
> 
> Backport the upstream fix, the otherwise shown kernel trace is
> potentially alarming but benign as also confirmed by upstream [1].
> 
> [...]

Applied, thanks!

[1/1] debian/patches: backport vmalloc gfp flag fix
      commit: 069198f9d5ca7876a4af06da2c42f848f0d0552e

Best regards,
-- 
Fabian Grünbichler <f.gruenbichler@proxmox.com>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-20  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20  8:36 [PATCH zfsonlinux] debian/patches: backport vmalloc gfp flag fix Christian Ebner
2026-05-20  8:46 ` applied: " Fabian Grünbichler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal