[packages/zfs] - rel 2, fix building kernel module on 5.10

baggins baggins at pld-linux.org
Tue May 19 23:19:53 CEST 2026


commit cc93f26fd373e320f0d6c795e82f87d71de7b944
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue May 19 23:19:17 2026 +0200

    - rel 2, fix building kernel module on 5.10

 ...x-zpl_super-handle-source-option-directly.patch | 89 ++++++++++++++++++++++
 zfs.spec                                           |  8 +-
 2 files changed, 94 insertions(+), 3 deletions(-)
---
diff --git a/zfs.spec b/zfs.spec
index d124063..cf0cd01 100644
--- a/zfs.spec
+++ b/zfs.spec
@@ -24,7 +24,7 @@ exit 1
 
 %define		_duplicate_files_terminate_build	0
 
-%define	rel	1
+%define	rel	2
 %define	pname	zfs
 Summary:	Native Linux port of the ZFS filesystem
 Summary(pl.UTF-8):	Natywny linuksowy port systemu plików ZFS
@@ -37,6 +37,7 @@ Source0:	https://github.com/openzfs/zfs/releases/download/zfs-%{version}/%{pname
 # Source0-md5:	a585680cfca997601e5ac80af303c88a
 Patch0:		initdir.patch
 Patch1:		pld.patch
+Patch2:		0001-linux-zpl_super-handle-source-option-directly.patch
 URL:		https://zfsonlinux.org/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -194,7 +195,7 @@ ZFS Linux kernel headers common for all PLD kernel versions.
 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
 wersji jąder PLD.
 
-%define	kernel_pkg()\
+%define	kernel_pkg() \
 %package -n kernel%{_alt_kernel}-zfs\
 Summary:	ZFS Linux kernel modules\
 Summary(pl.UTF-8):	ZFS - moduły jądra Linuksa\
@@ -243,7 +244,7 @@ pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
 %depmod %{_kernel_ver}\
 %{nil}
 
-%define build_kernel_pkg()\
+%define build_kernel_pkg() \
 export KERNEL_MAKE="ARCH=%_kernel_arch" \\\
 %configure \\\
 	KERNEL_CC="%{__cc}" \\\
@@ -265,6 +266,7 @@ p=`pwd`\
 %setup -q -n %{pname}-%{version}
 %patch -P0 -p1
 %patch -P1 -p1
+%patch -P2 -p1
 
 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
 	cmd/zarcsummary
diff --git a/0001-linux-zpl_super-handle-source-option-directly.patch b/0001-linux-zpl_super-handle-source-option-directly.patch
new file mode 100644
index 0000000..28c5464
--- /dev/null
+++ b/0001-linux-zpl_super-handle-source-option-directly.patch
@@ -0,0 +1,89 @@
+From 58c8dc5f6926eb96903a3f38b141e8998ef9261b Mon Sep 17 00:00:00 2001
+From: Rob Norris <rob.norris at truenas.com>
+Date: Thu, 14 May 2026 00:37:53 +1000
+Subject: [PATCH 01/30] linux/zpl_super: handle 'source' option directly
+
+vfs_parse_fs_param_source() didn't appear until 5.14, and was not
+backported to kernel.org LTS kernels. It's simple enough that it's
+easier to just handle it ourselves rather than use a configure check.
+
+Sponsored-by: TrueNAS
+Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
+Signed-off-by: Rob Norris <rob.norris at truenas.com>
+Closes #18529
+---
+ module/os/linux/zfs/zpl_super.c | 29 +++++++++++++++++++----------
+ 1 file changed, 19 insertions(+), 10 deletions(-)
+
+diff --git a/module/os/linux/zfs/zpl_super.c b/module/os/linux/zfs/zpl_super.c
+index 2cd0f17c8..c1460edd1 100644
+--- a/module/os/linux/zfs/zpl_super.c
++++ b/module/os/linux/zfs/zpl_super.c
+@@ -550,10 +550,11 @@ zpl_prune_sb(uint64_t nr_to_scan, void *arg)
+  *
+  * Finally, all filesystems get automatic handling for the 'source' option,
+  * that is, the "name" of the filesystem (the first column of df(1)'s output).
+- * However, this only happens if the handler does not otherwise handle
+- * the 'source' option. Since we handle _all_ options because of 'sloppy', we
+- * deal with this explicitly by calling into the kernel's helper for this,
+- * vfs_parse_fs_param_source(), which sets up fc->source.
++ * However, this only happens if the handler does not otherwise handle the
++ * 'source' option. Since we handle _all_ options because of 'sloppy', we have
++ * ot handle it ourselves. Normally we would call vfs_parse_fs_param_source()
++ * to deal with this, but that didn't appear until 5.14, and it's small enough
++ * that we can just handle it ourselves.
+  *
+  *	source
+  *
+@@ -565,6 +566,7 @@ zpl_prune_sb(uint64_t nr_to_scan, void *arg)
+  */
+ 
+ enum {
++	Opt_source,
+ 	Opt_exec, Opt_suid, Opt_dev,
+ 	Opt_atime, Opt_relatime, Opt_strictatime,
+ 	Opt_saxattr, Opt_dirxattr, Opt_noxattr,
+@@ -574,6 +576,8 @@ enum {
+ };
+ 
+ static const struct fs_parameter_spec zpl_param_spec[] = {
++	fsparam_string("source",	Opt_source),
++
+ 	fsparam_flag_no("exec",		Opt_exec),
+ 	fsparam_flag_no("suid",		Opt_suid),
+ 	fsparam_flag_no("dev",		Opt_dev),
+@@ -614,13 +618,8 @@ zpl_parse_param(struct fs_context *fc, struct fs_parameter *param)
+ {
+ 	vfs_t *vfs = fc->fs_private;
+ 
+-	/* Handle 'source' explicitly so we don't trip on it as an unknown. */
+-	int opt = vfs_parse_fs_param_source(fc, param);
+-	if (opt != -ENOPARAM)
+-		return (opt);
+-
+ 	struct fs_parse_result result;
+-	opt = fs_parse(fc, zpl_param_spec, param, &result);
++	int opt = fs_parse(fc, zpl_param_spec, param, &result);
+ 	if (opt == -ENOPARAM) {
+ 		/*
+ 		 * Convert unknowns to warnings, to work around the whole
+@@ -632,6 +631,16 @@ zpl_parse_param(struct fs_context *fc, struct fs_parameter *param)
+ 		return (opt);
+ 
+ 	switch (opt) {
++	case Opt_source:
++		if (fc->source != NULL) {
++			cmn_err(CE_NOTE,
++			    "ZFS: multiple 'source' options not supported");
++			return (-SET_ERROR(EINVAL));
++		}
++		fc->source = param->string;
++		param->string = NULL;
++		break;
++
+ 	case Opt_exec:
+ 		vfs->vfs_exec = !result.negated;
+ 		vfs->vfs_do_exec = B_TRUE;
+-- 
+2.54.0
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/zfs.git/commitdiff/cc93f26fd373e320f0d6c795e82f87d71de7b944



More information about the pld-cvs-commit mailing list