public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream
@ 2022-10-17 18:09 Stoiko Ivanov
  2022-10-17 18:09 ` [pve-devel] [PATCH zfsonlinux 1/2] cherry-pick a few patches from zfs-2.1.7-staging Stoiko Ivanov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2022-10-17 18:09 UTC (permalink / raw)
  To: pve-devel

While discussing whether to push the 2.1.6 packages further we noticed
that a small glitch happened on debian-upstream.
Our build should not be affected (we don't ship init-scripts), but syncing
the changes could help in a few corner cases (user installed 2.1.6-1 from
debian-upstream and then changed to our repositories is the one situation
I think might cause issues)

The remaining patches were included due to being quite limited in what
they do.

minimally tested on 2 VMs of mine with the current tip of pve-kernel/master
and on a hardware machine with ZFS on /

Stoiko Ivanov (2):
  cherry-pick a few patches from zfs-2.1.7-staging
  install zfs-load-key.service

 ...ramfs-use-mount.zfs-instead-of-mount.patch | 74 +++++++++++++++++++
 .../0013-etc-mask-zfs-load-key.service.patch  | 37 ++++++++++
 ...ould-have-its-argument-list-marked-v.patch | 40 ++++++++++
 debian/patches/series                         |  3 +
 debian/zfsutils-linux.install                 |  1 +
 5 files changed, 155 insertions(+)
 create mode 100644 debian/patches/0012-initramfs-use-mount.zfs-instead-of-mount.patch
 create mode 100644 debian/patches/0013-etc-mask-zfs-load-key.service.patch
 create mode 100644 debian/patches/0014-kcfpool_alloc-should-have-its-argument-list-marked-v.patch

-- 
2.30.2





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

* [pve-devel] [PATCH zfsonlinux 1/2] cherry-pick a few patches from zfs-2.1.7-staging
  2022-10-17 18:09 [pve-devel] [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream Stoiko Ivanov
@ 2022-10-17 18:09 ` Stoiko Ivanov
  2022-10-17 18:09 ` [pve-devel] [PATCH zfsonlinux 2/2] install zfs-load-key.service Stoiko Ivanov
  2022-10-18  6:41 ` [pve-devel] applied: [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2022-10-17 18:09 UTC (permalink / raw)
  To: pve-devel

While checking the current state of 2.1.6 we noticed that there were
some changes in debian-upstream [0] resulting from a bug-report in
zfs-upstream [1].

Our packages should be unaffected (they do not ship the
init-scripts in the first place).
Since the issue was fixed by zfs-upstream already on the
zfs-2.1.7-staging branch we should include it as well as it might save
users, who somehow got debian-upstream's zfs-packages installed on PVE
some trouble.

The other 2 changes seem small and isolated enough so including them
as well.

[0] https://salsa.debian.org/zfsonlinux-team/zfs/-/commits/master
[1] https://github.com/openzfs/zfs/issues/14010

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 ...ramfs-use-mount.zfs-instead-of-mount.patch | 74 +++++++++++++++++++
 .../0013-etc-mask-zfs-load-key.service.patch  | 37 ++++++++++
 ...ould-have-its-argument-list-marked-v.patch | 40 ++++++++++
 debian/patches/series                         |  3 +
 4 files changed, 154 insertions(+)
 create mode 100644 debian/patches/0012-initramfs-use-mount.zfs-instead-of-mount.patch
 create mode 100644 debian/patches/0013-etc-mask-zfs-load-key.service.patch
 create mode 100644 debian/patches/0014-kcfpool_alloc-should-have-its-argument-list-marked-v.patch

diff --git a/debian/patches/0012-initramfs-use-mount.zfs-instead-of-mount.patch b/debian/patches/0012-initramfs-use-mount.zfs-instead-of-mount.patch
new file mode 100644
index 00000000..84b9c7df
--- /dev/null
+++ b/debian/patches/0012-initramfs-use-mount.zfs-instead-of-mount.patch
@@ -0,0 +1,74 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Damian Szuberski <szuberskidamian@gmail.com>
+Date: Tue, 12 Apr 2022 00:51:23 +0200
+Subject: [PATCH] initramfs: use `mount.zfs` instead of `mount`
+
+A followup to d7a67402a85252e163aa8a9b69e7eda499db8c61
+
+For `mount -t zfs -o opts ds mp` command line
+some implementations of `mount(8)`, e. g. Busybox in Debian
+work as follows:
+
+```
+newfstatat(AT_FDCWD, "ds", 0x7fff826f4ab0, 0) = -1
+mount("ds", "mp", "zfs", MS_SILENT, NULL) = 0
+```
+
+The logic above skips completely `mount.zfs` and prevents us
+from reading filesystem properties and applying mount options.
+
+For comparison, the coreutils `mount(8)` implementation does:
+
+```
+openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_CLOEXEC) = 3
+// figure out that zfs is a `nodev` filesystem and look for a helper
+newfstatat(AT_FDCWD, "/sbin/mount.zfs" ...) = 0
+execve("/sbin/mount.zfs" ...) = 0
+```
+
+Using `mount.zfs` in initramfs would help circumvent deficiencies
+of some of `mount(8)` implementations. `mount -t zfs` translates
+to `mount.zfs` invocation, except for cases when explicitly disabled
+by `-i`.
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: szubersk <szuberskidamian@gmail.com>
+Closes #13305
+(cherry picked from commit 35d81a75a8c13e011e19fd12cf553d9c5849386e)
+(cherry picked from commit 4d22befde60087cbc6174122863353903df1d935)
+Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
+---
+ contrib/initramfs/scripts/zfs | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs
+index 814547b6f..9169adf5f 100644
+--- a/contrib/initramfs/scripts/zfs
++++ b/contrib/initramfs/scripts/zfs
+@@ -326,7 +326,7 @@ mount_fs()
+ 
+ 	# Need the _original_ datasets mountpoint!
+ 	mountpoint=$(get_fs_value "$fs" mountpoint)
+-	ZFS_CMD="mount -o zfsutil -t zfs"
++	ZFS_CMD="mount.zfs -o zfsutil"
+ 	if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then
+ 		# Can't use the mountpoint property. Might be one of our
+ 		# clones. Check the 'org.zol:mountpoint' property set in
+@@ -349,7 +349,7 @@ mount_fs()
+ 		# If it's not a legacy filesystem, it can only be a
+ 		# native one...
+ 		if [ "$mountpoint" = "legacy" ]; then
+-			ZFS_CMD="mount -t zfs"
++			ZFS_CMD="mount.zfs"
+ 		fi
+ 	fi
+ 
+@@ -915,7 +915,7 @@ mountroot()
+ 		echo "       not specified on the kernel command line."
+ 		echo ""
+ 		echo "Manually mount the root filesystem on $rootmnt and then exit."
+-		echo "Hint: Try:  mount -o zfsutil -t zfs ${ZFS_RPOOL-rpool}/ROOT/system $rootmnt"
++		echo "Hint: Try:  mount.zfs -o zfsutil ${ZFS_RPOOL-rpool}/ROOT/system $rootmnt"
+ 		shell
+ 	fi
+ 
diff --git a/debian/patches/0013-etc-mask-zfs-load-key.service.patch b/debian/patches/0013-etc-mask-zfs-load-key.service.patch
new file mode 100644
index 00000000..c8bb20d5
--- /dev/null
+++ b/debian/patches/0013-etc-mask-zfs-load-key.service.patch
@@ -0,0 +1,37 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczleweli@nabijaczleweli.xyz>
+Date: Thu, 13 Oct 2022 00:29:21 +0200
+Subject: [PATCH] etc: mask zfs-load-key.service
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Otherwise, systemd-sysv-generator will generate a service equivalent
+that breaks the boot: under systemd this is covered by
+zfs-mount-generator
+
+We already do this for zfs-import.service, and other init scripts are
+suppressed automatically by the "actual" .service files
+
+Fixes: commit f04b97620059d08b37d9e80ada397e742bb2f311 ("Add init script
+ to load keys")
+Reviewed-by: George Melikov <mail@gmelikov.ru>
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
+Closes #14010
+Closes #14019
+(cherry picked from commit 8cf59e97c4fc7b70723313953ceb0f777ca3bcdf)
+Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
+---
+ etc/systemd/system/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am
+index 8e6baeb68..af3ae597c 100644
+--- a/etc/systemd/system/Makefile.am
++++ b/etc/systemd/system/Makefile.am
+@@ -23,3 +23,4 @@ SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA)
+ install-data-hook:
+ 	$(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
+ 	ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service"
++	ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-load-key.service"
diff --git a/debian/patches/0014-kcfpool_alloc-should-have-its-argument-list-marked-v.patch b/debian/patches/0014-kcfpool_alloc-should-have-its-argument-list-marked-v.patch
new file mode 100644
index 00000000..2bc6be02
--- /dev/null
+++ b/debian/patches/0014-kcfpool_alloc-should-have-its-argument-list-marked-v.patch
@@ -0,0 +1,40 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Richard Yao <richard.yao@alumni.stonybrook.edu>
+Date: Wed, 12 Oct 2022 18:47:39 -0400
+Subject: [PATCH] kcfpool_alloc() should have its argument list marked void
+
+This error occurred when building on Gentoo with debugging enabled:
+
+zfs-kmod-2.1.6/work/zfs-2.1.6/module/icp/core/kcf_sched.c:1277:14:
+error: a function declaration without a prototype is deprecated
+in all versions of C [-Werror,-Wstrict-prototypes]
+  kcfpool_alloc()
+               ^
+               void
+1 error generated.
+
+This function is not present in master.
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Reviewed-by: Tony Hutter <hutter2@llnl.gov>
+Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
+Closes #14023
+(cherry picked from commit b0bc882395ed37f60cf9612250cb99b1322cd458)
+Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
+---
+ module/icp/core/kcf_sched.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/module/icp/core/kcf_sched.c b/module/icp/core/kcf_sched.c
+index 81fd15f8e..fa44a4dbf 100644
+--- a/module/icp/core/kcf_sched.c
++++ b/module/icp/core/kcf_sched.c
+@@ -1274,7 +1274,7 @@ kcf_aop_done(kcf_areq_node_t *areq, int error)
+  * Allocate the thread pool and initialize all the fields.
+  */
+ static void
+-kcfpool_alloc()
++kcfpool_alloc(void)
+ {
+ 	kcfpool = kmem_alloc(sizeof (kcf_pool_t), KM_SLEEP);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index d2770d39..b4367433 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,6 @@
 0009-Patch-move-manpage-arcstat-1-to-arcstat-8.patch
 0010-arcstat-Fix-integer-division-with-python3.patch
 0011-arc-stat-summary-guard-access-to-l2arc-MFU-MRU-stats.patch
+0012-initramfs-use-mount.zfs-instead-of-mount.patch
+0013-etc-mask-zfs-load-key.service.patch
+0014-kcfpool_alloc-should-have-its-argument-list-marked-v.patch
-- 
2.30.2





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

* [pve-devel] [PATCH zfsonlinux 2/2] install zfs-load-key.service
  2022-10-17 18:09 [pve-devel] [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream Stoiko Ivanov
  2022-10-17 18:09 ` [pve-devel] [PATCH zfsonlinux 1/2] cherry-pick a few patches from zfs-2.1.7-staging Stoiko Ivanov
@ 2022-10-17 18:09 ` Stoiko Ivanov
  2022-10-18  6:41 ` [pve-devel] applied: [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2022-10-17 18:09 UTC (permalink / raw)
  To: pve-devel

following upstream shipping it as a symlnk to /dev/null (to mask it)

follows commit b18419d7068b7ebcaa6dfbee85263177feffa711 from
debian-upstream:
https://salsa.debian.org/zfsonlinux-team/zfs/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 debian/zfsutils-linux.install | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/zfsutils-linux.install b/debian/zfsutils-linux.install
index 4e4554f8..bfc39cce 100644
--- a/debian/zfsutils-linux.install
+++ b/debian/zfsutils-linux.install
@@ -8,6 +8,7 @@ lib/systemd/system/zfs-import-scan.service
 lib/systemd/system/zfs-import@.service
 lib/systemd/system/zfs-import.target
 lib/systemd/system/zfs-import.service
+lib/systemd/system/zfs-load-key.service
 lib/systemd/system/zfs-mount.service
 lib/systemd/system/zfs-scrub-monthly@.timer
 lib/systemd/system/zfs-scrub-weekly@.timer
-- 
2.30.2





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

* [pve-devel] applied: [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream
  2022-10-17 18:09 [pve-devel] [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream Stoiko Ivanov
  2022-10-17 18:09 ` [pve-devel] [PATCH zfsonlinux 1/2] cherry-pick a few patches from zfs-2.1.7-staging Stoiko Ivanov
  2022-10-17 18:09 ` [pve-devel] [PATCH zfsonlinux 2/2] install zfs-load-key.service Stoiko Ivanov
@ 2022-10-18  6:41 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2022-10-18  6:41 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stoiko Ivanov

Am 17/10/2022 um 20:09 schrieb Stoiko Ivanov:
> While discussing whether to push the 2.1.6 packages further we noticed
> that a small glitch happened on debian-upstream.
> Our build should not be affected (we don't ship init-scripts), but syncing
> the changes could help in a few corner cases (user installed 2.1.6-1 from
> debian-upstream and then changed to our repositories is the one situation
> I think might cause issues)
> 
> The remaining patches were included due to being quite limited in what
> they do.
> 
> minimally tested on 2 VMs of mine with the current tip of pve-kernel/master
> and on a hardware machine with ZFS on /
> 
> Stoiko Ivanov (2):
>   cherry-pick a few patches from zfs-2.1.7-staging
>   install zfs-load-key.service
> 
>  ...ramfs-use-mount.zfs-instead-of-mount.patch | 74 +++++++++++++++++++
>  .../0013-etc-mask-zfs-load-key.service.patch  | 37 ++++++++++
>  ...ould-have-its-argument-list-marked-v.patch | 40 ++++++++++
>  debian/patches/series                         |  3 +
>  debian/zfsutils-linux.install                 |  1 +
>  5 files changed, 155 insertions(+)
>  create mode 100644 debian/patches/0012-initramfs-use-mount.zfs-instead-of-mount.patch
>  create mode 100644 debian/patches/0013-etc-mask-zfs-load-key.service.patch
>  create mode 100644 debian/patches/0014-kcfpool_alloc-should-have-its-argument-list-marked-v.patch
> 

applied, thanks!




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

end of thread, other threads:[~2022-10-18  6:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 18:09 [pve-devel] [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream Stoiko Ivanov
2022-10-17 18:09 ` [pve-devel] [PATCH zfsonlinux 1/2] cherry-pick a few patches from zfs-2.1.7-staging Stoiko Ivanov
2022-10-17 18:09 ` [pve-devel] [PATCH zfsonlinux 2/2] install zfs-load-key.service Stoiko Ivanov
2022-10-18  6:41 ` [pve-devel] applied: [PATCH zfsonlinux 0/2] add patches already on zfs-2.1.7-staging upstream Thomas Lamprecht

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