Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport-19.09] zfs: 0.8.2 -> 0.8.3 #80008

Merged
merged 4 commits into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 1e010beda2896bdf3082fb37a3e49f8ce20e04d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <[email protected]>
Date: Thu, 2 May 2019 05:28:08 +0100
Subject: [PATCH] x86/fpu: Export kernel_fpu_{begin,end}() with
EXPORT_SYMBOL_GPL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We need these symbols in zfs as the fpu implementation breaks userspace:

https://github.com/zfsonlinux/zfs/issues/9346
Signed-off-by: Jörg Thalheim <[email protected]>
---
arch/x86/kernel/fpu/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 12c70840980e..352538b3bb5d 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -102,7 +102,7 @@ void kernel_fpu_begin(void)
}
__cpu_invalidate_fpregs_state();
}
-EXPORT_SYMBOL_GPL(kernel_fpu_begin);
+EXPORT_SYMBOL(kernel_fpu_begin);

void kernel_fpu_end(void)
{
@@ -111,7 +111,7 @@ void kernel_fpu_end(void)
this_cpu_write(in_kernel_fpu, false);
preempt_enable();
}
-EXPORT_SYMBOL_GPL(kernel_fpu_end);
+EXPORT_SYMBOL(kernel_fpu_end);

/*
* Save the FPU state (mark it for reload if necessary):
--
2.23.0

10 changes: 8 additions & 2 deletions pkgs/os-specific/linux/kernel/patches.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@
};

export_kernel_fpu_functions = {
name = "export_kernel_fpu_functions";
patch = ./export_kernel_fpu_functions.patch;
"4.14" = {
name = "export_kernel_fpu_functions";
patch = ./export_kernel_fpu_functions_4_14.patch;
};
"5.3" = {
name = "export_kernel_fpu_functions";
patch = ./export_kernel_fpu_functions_5_3.patch;
};
};

# patches from https://lkml.org/lkml/2019/7/15/1748
Expand Down
36 changes: 0 additions & 36 deletions pkgs/os-specific/linux/zfs/build-fixes-0.8.patch

This file was deleted.

43 changes: 30 additions & 13 deletions pkgs/os-specific/linux/zfs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
, libtirpc
, nfs-utils
, gawk, gnugrep, gnused, systemd
, smartmontools, sysstat, sudo

# Kernel dependencies
, kernel ? null
Expand All @@ -19,7 +20,7 @@ let

common = { version
, sha256
, extraPatches
, extraPatches ? []
, rev ? "zfs-${version}"
, isUnstable ? false
, incompatibleKernelVersion ? null }:
Expand Down Expand Up @@ -55,6 +56,22 @@ let
substituteInPlace ./config/zfs-build.m4 --replace "\$sysconfdir/init.d" "$out/etc/init.d"
substituteInPlace ./etc/zfs/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
substituteInPlace ./cmd/zed/Makefile.am --replace "\$(sysconfdir)" "$out/etc"

substituteInPlace ./contrib/initramfs/hooks/Makefile.am \
--replace "/usr/share/initramfs-tools/hooks" "$out/usr/share/initramfs-tools/hooks"
substituteInPlace ./contrib/initramfs/Makefile.am \
--replace "/usr/share/initramfs-tools" "$out/usr/share/initramfs-tools"
substituteInPlace ./contrib/initramfs/scripts/Makefile.am \
--replace "/usr/share/initramfs-tools/scripts" "$out/usr/share/initramfs-tools/scripts"
substituteInPlace ./contrib/initramfs/scripts/local-top/Makefile.am \
--replace "/usr/share/initramfs-tools/scripts/local-top" "$out/usr/share/initramfs-tools/scripts/local-top"
substituteInPlace ./contrib/initramfs/scripts/Makefile.am \
--replace "/usr/share/initramfs-tools/scripts" "$out/usr/share/initramfs-tools/scripts"
substituteInPlace ./contrib/initramfs/scripts/local-top/Makefile.am \
--replace "/usr/share/initramfs-tools/scripts/local-top" "$out/usr/share/initramfs-tools/scripts/local-top"
substituteInPlace ./etc/systemd/system/Makefile.am \
--replace '$(DESTDIR)$(systemdunitdir)' "$out"'$(DESTDIR)$(systemdunitdir)'

substituteInPlace ./etc/systemd/system/zfs-share.service.in \
--replace "/bin/rm " "${coreutils}/bin/rm "

Expand Down Expand Up @@ -103,6 +120,7 @@ let
installFlags = [
"sysconfdir=\${out}/etc"
"DEFAULT_INITCONF_DIR=\${out}/default"
"INSTALL_MOD_PATH=\${out}"
];

postInstall = optionalString buildKernel ''
Expand Down Expand Up @@ -130,6 +148,13 @@ let
(cd $out/share/bash-completion/completions; ln -s zfs zpool)
'';

postFixup = ''
path="PATH=${makeBinPath [ coreutils gawk gnused gnugrep utillinux smartmontools sysstat sudo ]}"
for i in $out/libexec/zfs/zpool.d/*; do
sed -i "2i$path" $i
done
'';

outputs = [ "out" ] ++ optionals buildUser [ "lib" "dev" ];

meta = {
Expand All @@ -154,27 +179,19 @@ in {
# incompatibleKernelVersion = "4.20";

# this package should point to the latest release.
version = "0.8.2";

sha256 = "0miax0h2wg4b2kn8n93804faajy2n1sh25knyy2hg3k77nlr4pni";
version = "0.8.3";

extraPatches = [
./build-fixes-0.8.patch
];
sha256 = "0viql8rnqr32diapkpdsrwm6xj8vw5vi4dk2x2m7s7g0q2zdkahw";
};

zfsUnstable = common {
# comment/uncomment if breaking kernel versions are known
# incompatibleKernelVersion = "4.19";

# this package should point to a version / git revision compatible with the latest kernel release
version = "0.8.2";
version = "0.8.3";

sha256 = "0miax0h2wg4b2kn8n93804faajy2n1sh25knyy2hg3k77nlr4pni";
sha256 = "0viql8rnqr32diapkpdsrwm6xj8vw5vi4dk2x2m7s7g0q2zdkahw";
isUnstable = true;

extraPatches = [
./build-fixes-0.8.patch
];
};
}
9 changes: 6 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15747,21 +15747,24 @@ in
# when adding a new linux version
kernelPatches.cpu-cgroup-v2."4.11"
kernelPatches.modinst_arg_list_too_long
kernelPatches.export_kernel_fpu_functions
kernelPatches.export_kernel_fpu_functions."4.14"
];
};

linux_4_19 = callPackage ../os-specific/linux/kernel/linux-4.19.nix {
kernelPatches =
[ kernelPatches.bridge_stp_helper
kernelPatches.modinst_arg_list_too_long
kernelPatches.export_kernel_fpu_functions
kernelPatches.export_kernel_fpu_functions."4.14"
];
};

# Update this when adding the newest kernel major version!
linux_latest = callPackage ../os-specific/linux/kernel/linux-5.4.nix {
kernelPatches = [ kernelPatches.bridge_stp_helper ];
kernelPatches = [
kernelPatches.bridge_stp_helper
kernelPatches.export_kernel_fpu_functions."5.3"
];
};

linux_testing = callPackage ../os-specific/linux/kernel/linux-testing.nix {
Expand Down