From 2f73f5b8ed0602bdf8a0d7fbfb9643cb3a9740bd Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 22 Mar 2022 18:00:48 +0000 Subject: [PATCH] sys-fs/zfs-kmod: fix -Werror issue Closes: https://bugs.gentoo.org/835646 Signed-off-by: Sam James --- sys-fs/zfs-kmod/files/2.1.3-werror.patch | 30 ++++++++++++++++++++++++ sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild | 4 ++++ 2 files changed, 34 insertions(+) create mode 100644 sys-fs/zfs-kmod/files/2.1.3-werror.patch diff --git a/sys-fs/zfs-kmod/files/2.1.3-werror.patch b/sys-fs/zfs-kmod/files/2.1.3-werror.patch new file mode 100644 index 0000000000000..b4aba47d83246 --- /dev/null +++ b/sys-fs/zfs-kmod/files/2.1.3-werror.patch @@ -0,0 +1,30 @@ +https://bugs.gentoo.org/835646 +https://github.com/openzfs/zfs/commit/7b215d93bcc0a72d7020ccc050c64f39aa7f2be8.patch + +From: Ryan Moeller +Date: Thu, 17 Mar 2022 13:18:23 -0400 +Subject: [PATCH] Fix module build with -Werror + +This is a direct commit to zfs-2.1-release to fix release builds that +error out on an unused variable. The issue is avoided on master by a +huge series of commits that change how the ASSERT macros work, but that +is not feasible to backport. + +Reviewed-by: Tony Hutter +Reviewed-by: Brian Behlendorf +Reviewed-by: Igor Kozhukhov +Signed-off-by: Ryan Moeller +Closes #13194 +Closes #13196 +--- a/module/zfs/arc.c ++++ b/module/zfs/arc.c +@@ -1205,7 +1205,7 @@ static void + hdr_l2only_dest(void *vbuf, void *unused) + { + (void) unused; +- arc_buf_hdr_t *hdr = vbuf; ++ arc_buf_hdr_t *hdr __maybe_unused = vbuf; + + ASSERT(HDR_EMPTY(hdr)); + arc_space_return(HDR_L2ONLY_SIZE, ARC_SPACE_L2HDRS); + diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild index 2c6ab28bcfde2..39f9cc590a1ad 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-2.1.3.ebuild @@ -62,6 +62,10 @@ RESTRICT="debug? ( strip ) test" DOCS=( AUTHORS COPYRIGHT META README.md ) +PATCHES=( + "${FILESDIR}"/${PV}-werror.patch +) + pkg_pretend() { use rootfs || return 0