zfs: upgrade 2.2.8 -> 2.2.9

Also include tag in the SRC_URI and refreshed patches.

Backported patch 0004-linux-use-sys-stat.h-instead-of-linux-stat.h.patch
to resolve build failure with musl.

Release Notes:
https://github.com/openzfs/zfs/releases/tag/zfs-2.2.9

Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
This commit is contained in:
Ankur Tyagi
2026-03-10 11:13:54 +13:00
committed by Anuj Mittal
parent 6f6a7b518e
commit dd54c60cb3
5 changed files with 98 additions and 16 deletions
@@ -1,4 +1,4 @@
From cc0cd6f71f6ef96fca2d7b730a3f0f6722fec696 Mon Sep 17 00:00:00 2001
From 339359b9af5f24dedebe7234edd586e3fcacd436 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 7 May 2022 12:15:22 -0700
Subject: [PATCH] Define strndupa if it does not exist
@@ -7,13 +7,12 @@ musl e.g. does not supply strndupa, unlike glibc
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
etc/systemd/system-generators/zfs-mount-generator.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/etc/systemd/system-generators/zfs-mount-generator.c b/etc/systemd/system-generators/zfs-mount-generator.c
index f4c6c26..255bee4 100644
index ab5dc4d78..d70cd2617 100644
--- a/etc/systemd/system-generators/zfs-mount-generator.c
+++ b/etc/systemd/system-generators/zfs-mount-generator.c
@@ -193,6 +193,15 @@ fopenat(int dirfd, const char *pathname, int flags,
@@ -1,4 +1,4 @@
From aaf28a4630af60496c9d33db1d06a7d7d8983422 Mon Sep 17 00:00:00 2001
From d05d2583ae1807e380492ea8570106c1f0a9effb Mon Sep 17 00:00:00 2001
From: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Date: Tue, 23 May 2023 13:50:24 +0600
Subject: [PATCH] fixes broken aarch64 inline assembly for gcc 13.1
@@ -39,9 +39,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
module/Kbuild.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/module/Kbuild.in b/module/Kbuild.in
index a72d2a4cc..c6134baec 100644
--- a/module/Kbuild.in
+++ b/module/Kbuild.in
@@ -57,9 +57,9 @@ asflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_
@@ -57,9 +57,9 @@ asflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
ifeq ($(CONFIG_ARM64),y)
@@ -1,4 +1,4 @@
From 1f9a5cb860b3509791e59a8cae9d5f265e832ed0 Mon Sep 17 00:00:00 2001
From b37f4e0f11186206863f41e1a638ca4e57c3dc53 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 28 May 2023 16:33:15 -0700
Subject: [PATCH] fs-tests/cmd/readmmap: Replace uint_t with uint32_t
@@ -12,7 +12,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/zfs-tests/cmd/readmmap.c b/tests/zfs-tests/cmd/readmmap.c
index 704ffd55c8..a2590e0e8d 100644
index a5c8079d0..c22b58e9d 100644
--- a/tests/zfs-tests/cmd/readmmap.c
+++ b/tests/zfs-tests/cmd/readmmap.c
@@ -38,6 +38,7 @@
@@ -23,7 +23,7 @@ index 704ffd55c8..a2590e0e8d 100644
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -55,7 +56,7 @@ main(int argc, char **argv)
@@ -56,7 +57,7 @@ main(int argc, char **argv)
char *buf = NULL;
char *map = NULL;
int fd = -1, bytes, retval = 0;
@@ -32,7 +32,7 @@ index 704ffd55c8..a2590e0e8d 100644
if (argc < 2 || optind == argc) {
(void) fprintf(stderr,
@@ -92,7 +93,7 @@ main(int argc, char **argv)
@@ -93,7 +94,7 @@ main(int argc, char **argv)
retval = 1;
goto end;
}
@@ -41,6 +41,3 @@ index 704ffd55c8..a2590e0e8d 100644
srandom(seed);
idx = random() % size;
--
2.40.1
@@ -0,0 +1,83 @@
From a4d9aadf0094392e5e477dbc8c43f973692dab00 Mon Sep 17 00:00:00 2001
From: classabbyamp <5366828+classabbyamp@users.noreply.github.com>
Date: Wed, 27 Aug 2025 17:42:32 -0400
Subject: [PATCH] linux: use sys/stat.h instead of linux/stat.h
glibc includes linux/stat.h for statx, but musl defines its own statx
struct and associated constants, which does not include STATX_MNT_ID
yet. Thus, including linux/stat.h directly should be avoided for
maximum libc compatibility.
Tested on:
- glibc: x86_64, i686, aarch64, armv7l, armv6l
- musl: x86_64, aarch64, armv7l, armv6l
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Tested-By: Achill Gilgenast <achill@achill.org>
Signed-off-by: classabbyamp <dev@placeviolette.net>
Closes #17675
(cherry picked from commit ccf5a8a6fcfdfbdaa2f0fdca5d787958224bf06d)
Upstream-Status: Backport [https://github.com/openzfs/zfs/commit/ccf5a8a6fcfdfbdaa2f0fdca5d787958224bf06d]
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
config/user-statx.m4 | 6 +++---
include/os/linux/spl/sys/stat.h | 2 +-
lib/libspl/include/os/linux/sys/stat.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/config/user-statx.m4 b/config/user-statx.m4
index 0315f93e0..1ba74a40e 100644
--- a/config/user-statx.m4
+++ b/config/user-statx.m4
@@ -2,7 +2,7 @@ dnl #
dnl # Check for statx() function and STATX_MNT_ID availability
dnl #
AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
- AC_CHECK_HEADERS([linux/stat.h],
+ AC_CHECK_HEADERS([sys/stat.h],
[have_stat_headers=yes],
[have_stat_headers=no])
@@ -14,7 +14,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
AC_MSG_CHECKING([for STATX_MNT_ID])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
- #include <linux/stat.h>
+ #include <sys/stat.h>
]], [[
struct statx stx;
int mask = STATX_MNT_ID;
@@ -29,6 +29,6 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_STATX], [
])
])
], [
- AC_MSG_WARN([linux/stat.h not found; skipping statx support])
+ AC_MSG_WARN([sys/stat.h not found; skipping statx support])
])
]) dnl end AC_DEFUN
diff --git a/include/os/linux/spl/sys/stat.h b/include/os/linux/spl/sys/stat.h
index 598784964..5c8cff72e 100644
--- a/include/os/linux/spl/sys/stat.h
+++ b/include/os/linux/spl/sys/stat.h
@@ -24,6 +24,6 @@
#ifndef _SPL_STAT_H
#define _SPL_STAT_H
-#include <linux/stat.h>
+#include <sys/stat.h>
#endif /* SPL_STAT_H */
diff --git a/lib/libspl/include/os/linux/sys/stat.h b/lib/libspl/include/os/linux/sys/stat.h
index 5fbe892ee..ef8738fa8 100644
--- a/lib/libspl/include/os/linux/sys/stat.h
+++ b/lib/libspl/include/os/linux/sys/stat.h
@@ -32,7 +32,7 @@
#ifdef HAVE_STATX
#include <fcntl.h>
-#include <linux/stat.h>
+#include <sys/stat.h>
#endif
/*
@@ -4,11 +4,12 @@ LICENSE = "CDDL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=7087caaf1dc8a2856585619f4a787faa"
HOMEPAGE = "https://github.com/openzfs/zfs"
SRCREV = "3e4a3e161c00273303cd9fa9e0dc09ead3499a8a"
SRC_URI = "git://github.com/openzfs/zfs;protocol=https;branch=zfs-2.2-release \
SRCREV = "079ba86d71571bf997ff688da061d8c4aa2fd052"
SRC_URI = "git://github.com/openzfs/zfs;protocol=https;branch=zfs-2.2-release;tag=${BP} \
file://0001-Define-strndupa-if-it-does-not-exist.patch \
file://aaf28a4630af60496c9d33db1d06a7d7d8983422.patch \
file://0001-fs-tests-cmd-readmmap-Replace-uint_t-with-uint32_t.patch \
file://0002-fixes-broken-aarch64-inline-assembly-for-gcc-13.1.patch \
file://0003-fs-tests-cmd-readmmap-Replace-uint_t-with-uint32_t.patch \
file://0004-linux-use-sys-stat.h-instead-of-linux-stat.h.patch \
"