diff options
Diffstat (limited to 'experimental')
-rw-r--r-- | experimental/sbcl/APKBUILD | 38 | ||||
-rw-r--r-- | experimental/sbcl/musl-libc.patch | 180 | ||||
-rw-r--r-- | experimental/zfs-utils/APKBUILD | 49 | ||||
-rw-r--r-- | experimental/zfs/APKBUILD | 68 | ||||
-rw-r--r-- | experimental/zfs/Linux-5.6-compat-ktime_get_raw_ts64-ff5587d65137.patch | 145 | ||||
-rw-r--r-- | experimental/zfs/Linux-5.6-compat-time_t-2c3a83701dd1.patch | 110 | ||||
-rw-r--r-- | experimental/zfs/Linux-5.6-compat-timestamp_truncate-795699a6cc28.patch | 131 | ||||
-rw-r--r-- | experimental/zfs/fix-autoconf-redirection-for-dash.patch | 11 |
8 files changed, 732 insertions, 0 deletions
diff --git a/experimental/sbcl/APKBUILD b/experimental/sbcl/APKBUILD new file mode 100644 index 000000000..86f9ab1f5 --- /dev/null +++ b/experimental/sbcl/APKBUILD @@ -0,0 +1,38 @@ +# Contributor: Lee Starnes <lee@canned-death.us> +# Maintainer: Lee Starnes <lee@canned-death.us> +pkgname=sbcl +pkgver=2.0.3 +pkgrel=0 +pkgdesc="Steel Bank Common Lisp" +url="http://www.sbcl.org" +arch="all !armv7" +license="BSD-2-Clause AND BSD-2-Clause-FreeBSD AND BSD-3-Clause AND MIT" +depends="" +makedepends="clisp clisp-dev" +checkdepends="ed" +subpackages="$pkgname-doc" +# Patch provided by Eric Timmons: https://bugs.launchpad.net/sbcl/+bug/1768368 +source="https://sourceforge.net/projects/$pkgname/files/$pkgname/$pkgver/$pkgname-$pkgver-source.tar.bz2 + musl-libc.patch" + +prepare() { + default_prepare + + # run-program test is hard-coded to use /bin/ed but it should be /usr/bin/ed + sed -i 's,/bin/ed,/usr/bin/ed,g' tests/run-program.impure.lisp +} + +build() { + ./make.sh --prefix=/usr --with-dlclose-is-noop --xc-host=clisp +} + +check() { + cd tests && sh run-tests.sh +} + +package() { + INSTALL_ROOT="$pkgdir"/usr sh install.sh +} + +sha512sums="c29c115fff0e118e5c05959dd8d73ae876458daeb5ddde67ce485b10e6d1583b1f8a9597b54b45606696ab1b1eea5392dcb09357c83fce31323f2a5a154f2dd1 sbcl-2.0.3-source.tar.bz2 +e6757e4cc623682c501ab5e255a881833ff393efac829ffe9f67fff0a005724c3c03a23352b4c88d58b3d15dbb0cf33c8cc58d72d3795abb2f12a4bca4302165 musl-libc.patch" diff --git a/experimental/sbcl/musl-libc.patch b/experimental/sbcl/musl-libc.patch new file mode 100644 index 000000000..1aa5cb557 --- /dev/null +++ b/experimental/sbcl/musl-libc.patch @@ -0,0 +1,180 @@ +diff --git a/contrib/sb-bsd-sockets/constants.lisp b/contrib/sb-bsd-sockets/constants.lisp +index 88f5bb7c4..23fd87277 100644 +--- a/contrib/sb-bsd-sockets/constants.lisp ++++ b/contrib/sb-bsd-sockets/constants.lisp +@@ -93,8 +93,8 @@ + (:integer EAFNOSUPPORT "EAFNOSUPPORT") + (:integer EINPROGRESS "EINPROGRESS") + +- (:integer NETDB-INTERNAL #+hpux "h_NETDB_INTERNAL" #-hpux "NETDB_INTERNAL" "See errno.") +- (:integer NETDB-SUCCESS #+hpux "h_NETDB_SUCCESS" #-hpux "NETDB_SUCCESS" "No problem.") ++ (:integer-no-check NETDB-INTERNAL #-os-provides-netdb-internal "-1" #+(and os-provides-netdb-internal hpux) "h_NETDB_INTERNAL" #+(and os-provides-netdb-internal (not hpux)) "NETDB_INTERNAL" "See errno.") ++ (:integer-no-check NETDB-SUCCESS #-os-provides-netdb-internal "0" #+(and os-provides-netdb-internal hpux) "h_NETDB_SUCCESS" #+(and os-provides-netdb-internal (not hpux)) "NETDB_SUCCESS" "No problem.") + (:integer HOST-NOT-FOUND "HOST_NOT_FOUND" "Authoritative Answer Host not found.") + (:integer TRY-AGAIN "TRY_AGAIN" "Non-Authoritative Host not found, or SERVERFAIL.") + (:integer NO-RECOVERY "NO_RECOVERY" "Non recoverable errors, FORMERR, REFUSED, NOTIMP.") +diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c +index fa4f5e490..60b5fea4e 100644 +--- a/src/runtime/linux-os.c ++++ b/src/runtime/linux-os.c +@@ -187,8 +187,15 @@ isnptl (void) + if (strstr (buf, "NPTL")) { + return 1; + } ++ else { ++ return 0; ++ } ++ } ++ else { ++ /* If the configuration variable is empty, just assume we have a ++ * good enough thread implementation. */ ++ return 1; + } +- return 0; + } + #endif + +diff --git a/tests/foreign.test.sh b/tests/foreign.test.sh +index 7fb757813..9ba8ed3cf 100755 +--- a/tests/foreign.test.sh ++++ b/tests/foreign.test.sh +@@ -248,16 +248,23 @@ cat > $TEST_FILESTEM.test.lisp <<EOF + (assert (= 13 foo)) + (assert (= 42 (bar))) + (note "/original definitions ok") +- (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b.bak") +- (rename-file "$TEST_FILESTEM-b2.so" "$TEST_FILESTEM-b.so") +- (load-shared-object (truename "$TEST_FILESTEM-b.so")) +- (note "/reloading ok") +- (assert (= 42 foo)) +- (assert (= 13 (bar))) +- (note "/redefined versions ok") +- (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b2.so") +- (rename-file "$TEST_FILESTEM-b.bak" "$TEST_FILESTEM-b.so") +- (note "/renamed back to originals") ++ ;; test late resolution ++ (eval-when (:compile-toplevel :load-toplevel :execute) ++ (setq *features* (union *features* sb-impl:+internal-features+))) ++ #+dlclose-is-noop ++ (note "/skipping reloading tests") ++ #-dlclose-is-noop ++ (progn ++ (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b.bak") ++ (rename-file "$TEST_FILESTEM-b2.so" "$TEST_FILESTEM-b.so") ++ (load-shared-object (truename "$TEST_FILESTEM-b.so")) ++ (note "/reloading ok") ++ (assert (= 42 foo)) ++ (assert (= 13 (bar))) ++ (note "/redefined versions ok") ++ (rename-file "$TEST_FILESTEM-b.so" "$TEST_FILESTEM-b2.so") ++ (rename-file "$TEST_FILESTEM-b.bak" "$TEST_FILESTEM-b.so") ++ (note "/renamed back to originals")) + + ;; test late resolution + #+linkage-table +@@ -274,13 +278,17 @@ cat > $TEST_FILESTEM.test.lisp <<EOF + (load-shared-object (truename "$TEST_FILESTEM-c.so")) + (assert (= 43 late-foo)) + (assert (= 14 (late-bar))) +- (unload-shared-object (truename "$TEST_FILESTEM-c.so")) +- (multiple-value-bind (val err) (ignore-errors late-foo) +- (assert (not val)) +- (assert (typep err 'undefined-alien-error))) +- (multiple-value-bind (val err) (ignore-errors (late-bar)) +- (assert (not val)) +- (assert (typep err 'undefined-alien-error))) ++ #+dlclose-is-noop ++ (note "/skipping unloading tests") ++ #-dlclose-is-noop ++ (progn ++ (unload-shared-object (truename "$TEST_FILESTEM-c.so")) ++ (multiple-value-bind (val err) (ignore-errors late-foo) ++ (assert (not val)) ++ (assert (typep err 'undefined-alien-error))) ++ (multiple-value-bind (val err) (ignore-errors (late-bar)) ++ (assert (not val)) ++ (assert (typep err 'undefined-alien-error)))) + (note "/linkage table ok")) + + (sb-ext:exit :code $EXIT_LISP_WIN) ; success convention for Lisp program +diff --git a/tools-for-build/Makefile b/tools-for-build/Makefile +index 3f6e4ecf9..39bab2b92 100644 +--- a/tools-for-build/Makefile ++++ b/tools-for-build/Makefile +@@ -16,6 +16,9 @@ LDLIBS:=$(OS_LIBS) + + all: grovel-headers determine-endianness where-is-mcontext + ++dlclose-is-noop-test-helper.so: dlclose-is-noop-test-helper.c ++ @$(CC) $(LDFLAGS) -shared $< -o $@ $(LOADLIBES) $(LDLIBS) ++ + clean: + rm -f *.o grovel-headers determine-endianness where-is-mcontext + rm -f *.exe +diff --git a/tools-for-build/dlclose-is-noop-test-helper.c b/tools-for-build/dlclose-is-noop-test-helper.c +new file mode 100644 +index 000000000..4be7a8e5b +--- /dev/null ++++ b/tools-for-build/dlclose-is-noop-test-helper.c +@@ -0,0 +1 @@ ++int sbcl_dl_close_test = 42; +diff --git a/tools-for-build/dlclose-is-noop-test.c b/tools-for-build/dlclose-is-noop-test.c +new file mode 100644 +index 000000000..f4eab26a5 +--- /dev/null ++++ b/tools-for-build/dlclose-is-noop-test.c +@@ -0,0 +1,19 @@ ++/* test to build and run so that we know if we have a noop dlclose ++ */ ++ ++#include <dlfcn.h> ++#include <stddef.h> ++ ++int main () ++{ ++ void * handle = dlopen("./dlclose-is-noop-test-helper.so", RTLD_NOW | RTLD_GLOBAL); ++ dlclose(handle); ++ ++ handle = dlopen("./dlclose-is-noop-test-helper.so", RTLD_NOW | RTLD_NOLOAD); ++ ++ if (handle != NULL) { ++ return 104; ++ } else { ++ return 0; ++ } ++} +diff --git a/tools-for-build/grovel-features.sh b/tools-for-build/grovel-features.sh +index ffc4307eb..bf1448a6a 100644 +--- a/tools-for-build/grovel-features.sh ++++ b/tools-for-build/grovel-features.sh +@@ -36,3 +36,12 @@ + if [ "$sbcl_arch" = arm ] ; then + featurep arm-softfp + fi ++ ++featurep os-provides-netdb-internal ++ ++# We need a helper shared library to test dlclose-is-noop ++$GNUMAKE dlclose-is-noop-test-helper.so > /dev/null 2>&1 ++ ++featurep dlclose-is-noop ++ ++rm -f dlclose-is-noop-test-helper.so +diff --git a/tools-for-build/os-provides-netdb-internal-test.c b/tools-for-build/os-provides-netdb-internal-test.c +new file mode 100644 +index 000000000..cab08cc41 +--- /dev/null ++++ b/tools-for-build/os-provides-netdb-internal-test.c +@@ -0,0 +1,12 @@ ++#include <netdb.h> ++ ++int main () ++{ ++#if defined NETDB_INTERNAL && defined NETDB_SUCCESS ++ return 104; ++#elif defined h_NETDB_INTERNAL && defined h_NETDB_SUCCESS ++ return 104; ++#else ++ return 0; ++#endif ++} diff --git a/experimental/zfs-utils/APKBUILD b/experimental/zfs-utils/APKBUILD new file mode 100644 index 000000000..dc985302e --- /dev/null +++ b/experimental/zfs-utils/APKBUILD @@ -0,0 +1,49 @@ +# Contributor: Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> +# Maintainer: Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> +# keep these in sync with kernel version +_kflavour="" +_kver="5.4.5-mc0" +_kver2="$_kver-easy" +pkgname=zfs-utils +pkgver=0.8.3 +pkgrel=0 +pkgdesc="User utilities for the ZFS filesystem" +url="https://open-zfs.org" +arch="all" +license="CDDL" +depends="" +makedepends="eudev-dev libtirpc-dev linux-headers openssl-dev zlib-dev" +install="" +subpackages="$pkgname-dev $pkgname-doc zfs-openrc" +source="https://github.com/zfsonlinux/zfs/releases/download/zfs-$pkgver/zfs-$pkgver.tar.gz" +builddir="$srcdir/zfs-$pkgver" + +prepare() { + default_prepare + update_config_sub +} + +build() { + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --with-linux=/usr/src/linux-$_kver \ + --with-spec=generic \ + --with-config=user + make +} + +check() { + make check +} + +package() { + make DESTDIR="$pkgdir" install + rm -r "$pkgdir/usr/share/zfs/zfs-tests" +} + +sha512sums="aded632e6b04180560d4f2ff283260016e883dadae4e7fda9070b7113dee948099cb7a7b183f1c8139654389a2610fb9cc6f997acdc846040e605125cf016010 zfs-0.8.3.tar.gz" diff --git a/experimental/zfs/APKBUILD b/experimental/zfs/APKBUILD new file mode 100644 index 000000000..31991c44d --- /dev/null +++ b/experimental/zfs/APKBUILD @@ -0,0 +1,68 @@ +# Contributor: Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> +# Maintainer: Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> +# keep these in sync with kernel version +_kflavour="" +_kver="5.4.5-mc0" +_kver2="$_kver-easy" +pkgname="zfs-$_kver" +pkgver=0.8.3 +pkgrel=0 +pkgdesc="Linux support for the ZFS filesystem" +url="https://open-zfs.org" +arch="all" +license="CDDL" +depends="easy-kernel$_kflavour-modules-$_kver zfs-utils" +makedepends="eudev-dev libtirpc-dev linux-headers openssl-dev zlib-dev + easy-kernel$_kflavour-src-$_kver autoconf automake libtool" +install="" +subpackages="$pkgname-dev" +source="https://github.com/zfsonlinux/zfs/releases/download/zfs-$pkgver/zfs-$pkgver.tar.gz + fix-autoconf-redirection-for-dash.patch + Linux-5.6-compat-time_t-2c3a83701dd1.patch + Linux-5.6-compat-timestamp_truncate-795699a6cc28.patch + Linux-5.6-compat-ktime_get_raw_ts64-ff5587d65137.patch" +builddir="$srcdir/zfs-$pkgver" + +prepare() { + default_prepare + update_config_sub + ./autogen.sh +} + +build() { + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --with-linux=/usr/src/linux-$_kver \ + --with-spec=generic \ + --with-config=kernel + make +} + +check() { + make check +} + +package() { + make DESTDIR="$pkgdir" install +} + +dev() { + default_dev + mv "$pkgdir/usr/src/spl-$pkgver" "$subpkgdir/usr/src" + cd "$pkgdir/usr/src/zfs-$pkgver" + mv zfs.release.in zfs_config.h.in "$subpkgdir/usr/src/zfs-$pkgver" + cd "$pkgdir/usr/src/zfs-$pkgver/$_kver2" + mv Module.symvers zfs.release spl.release "$subpkgdir/usr/src/zfs-$pkgver/$_kver2" + rm -r "$pkgdir/usr/src" +} + +sha512sums="aded632e6b04180560d4f2ff283260016e883dadae4e7fda9070b7113dee948099cb7a7b183f1c8139654389a2610fb9cc6f997acdc846040e605125cf016010 zfs-0.8.3.tar.gz +47dc563fc1daa4c67096d2316ed2cea6aeaf4ca9e0daa41f2036a4ff3dcb542c88534ac25033a23e8fa97a9b82e56a8933f9fa56bae8a1fa07c1b15eb18f68f8 fix-autoconf-redirection-for-dash.patch +a74bb30ef2e5f28fdc7b0cfe915f2841762ec8f6cd2368d2e4ba8627443e8e0754011a88b743e27519d191464e35e6c923510451f2a86d7e1a4ad3c5b737015f Linux-5.6-compat-time_t-2c3a83701dd1.patch +a791406265a6e1501e743b6f13764736439a14a9dfc1feaabc5fc82e27de1b2adf56b566c162fc42313f311fbf76c3213f7c2c05a518de36f96887e3d462e94a Linux-5.6-compat-timestamp_truncate-795699a6cc28.patch +9c78793a5840bc5fb5bb44a210124c1c8f09ce0ddfe88b91be8dbde5465763912308b89cd87300fd05b898076366528612c34a9c2f834d3b6573aa68eb442ec3 Linux-5.6-compat-ktime_get_raw_ts64-ff5587d65137.patch"
\ No newline at end of file diff --git a/experimental/zfs/Linux-5.6-compat-ktime_get_raw_ts64-ff5587d65137.patch b/experimental/zfs/Linux-5.6-compat-ktime_get_raw_ts64-ff5587d65137.patch new file mode 100644 index 000000000..1b0402d29 --- /dev/null +++ b/experimental/zfs/Linux-5.6-compat-ktime_get_raw_ts64-ff5587d65137.patch @@ -0,0 +1,145 @@ +commit ff5587d651371ab496f7962e85fe2c337fdb8a59 +Author: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Wed Feb 26 12:42:33 2020 -0800 + + Linux 5.6 compat: ktime_get_raw_ts64() + + The getrawmonotonic() and getrawmonotonic64() interfaces have been + fully retired. Update gethrtime() to use the replacement interface + ktime_get_raw_ts64() which was introduced in the 4.18 kernel. + + Reviewed-by: Tony Hutter <hutter2@llnl.gov> + Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> + Closes #10052 + Closes #10064 + +diff --git a/config/kernel-ktime.m4 b/config/kernel-ktime.m4 +new file mode 100644 +index 000000000..64c3b5f90 +--- /dev/null ++++ b/config/kernel-ktime.m4 +@@ -0,0 +1,55 @@ ++dnl # ++dnl # 4.18: ktime_get_coarse_real_ts64() replaces current_kernel_time64(). ++dnl # ++AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME_GET_COARSE_REAL_TS64], [ ++ ZFS_LINUX_TEST_SRC([ktime_get_coarse_real_ts64], [ ++ #include <linux/mm.h> ++ ], [ ++ struct timespec64 ts; ++ ktime_get_coarse_real_ts64(&ts); ++ ]) ++]) ++ ++AC_DEFUN([ZFS_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64], [ ++ AC_MSG_CHECKING([whether ktime_get_coarse_real_ts64() exists]) ++ ZFS_LINUX_TEST_RESULT([ktime_get_coarse_real_ts64], [ ++ AC_MSG_RESULT(yes) ++ AC_DEFINE(HAVE_KTIME_GET_COARSE_REAL_TS64, 1, ++ [ktime_get_coarse_real_ts64() exists]) ++ ], [ ++ AC_MSG_RESULT(no) ++ ]) ++]) ++ ++dnl # ++dnl # 4.18: ktime_get_raw_ts64() replaces getrawmonotonic64(). ++dnl # ++AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME_GET_RAW_TS64], [ ++ ZFS_LINUX_TEST_SRC([ktime_get_raw_ts64], [ ++ #include <linux/mm.h> ++ ], [ ++ struct timespec64 ts; ++ ktime_get_raw_ts64(&ts); ++ ]) ++]) ++ ++AC_DEFUN([ZFS_AC_KERNEL_KTIME_GET_RAW_TS64], [ ++ AC_MSG_CHECKING([whether ktime_get_raw_ts64() exists]) ++ ZFS_LINUX_TEST_RESULT([ktime_get_raw_ts64], [ ++ AC_MSG_RESULT(yes) ++ AC_DEFINE(HAVE_KTIME_GET_RAW_TS64, 1, ++ [ktime_get_raw_ts64() exists]) ++ ], [ ++ AC_MSG_RESULT(no) ++ ]) ++]) ++ ++AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME], [ ++ ZFS_AC_KERNEL_SRC_KTIME_GET_COARSE_REAL_TS64 ++ ZFS_AC_KERNEL_SRC_KTIME_GET_RAW_TS64 ++]) ++ ++AC_DEFUN([ZFS_AC_KERNEL_KTIME], [ ++ ZFS_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64 ++ ZFS_AC_KERNEL_KTIME_GET_RAW_TS64 ++]) +diff --git a/config/kernel-ktime_get_coarse_real_ts64.m4 b/config/kernel-ktime_get_coarse_real_ts64.m4 +deleted file mode 100644 +index 28492bf04..000000000 +--- a/config/kernel-ktime_get_coarse_real_ts64.m4 ++++ /dev/null +@@ -1,23 +0,0 @@ +-dnl # +-dnl # 4.18: ktime_get_coarse_real_ts64() added. Use it in place of +-dnl # current_kernel_time64(). +-dnl # +-AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME_GET_COARSE_REAL_TS64], [ +- ZFS_LINUX_TEST_SRC([ktime_get_coarse_real_ts64], [ +- #include <linux/mm.h> +- ], [ +- struct timespec64 ts; +- ktime_get_coarse_real_ts64(&ts); +- ]) +-]) +- +-AC_DEFUN([ZFS_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64], [ +- AC_MSG_CHECKING([whether ktime_get_coarse_real_ts64() exists]) +- ZFS_LINUX_TEST_RESULT([ktime_get_coarse_real_ts64], [ +- AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_KTIME_GET_COARSE_REAL_TS64, 1, +- [ktime_get_coarse_real_ts64() exists]) +- ], [ +- AC_MSG_RESULT(no) +- ]) +-]) +diff --git a/config/kernel.m4 b/config/kernel.m4 +index 6bb37937c..a0fa2514e 100644 +--- a/config/kernel.m4 ++++ b/config/kernel.m4 +@@ -114,7 +114,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ + ZFS_AC_KERNEL_SRC_CURRENT_TIME + ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES + ZFS_AC_KERNEL_SRC_IN_COMPAT_SYSCALL +- ZFS_AC_KERNEL_SRC_KTIME_GET_COARSE_REAL_TS64 ++ ZFS_AC_KERNEL_SRC_KTIME + ZFS_AC_KERNEL_SRC_TOTALRAM_PAGES_FUNC + ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES + ZFS_AC_KERNEL_SRC_KSTRTOUL +@@ -208,7 +208,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ + ZFS_AC_KERNEL_CURRENT_TIME + ZFS_AC_KERNEL_USERNS_CAPABILITIES + ZFS_AC_KERNEL_IN_COMPAT_SYSCALL +- ZFS_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64 ++ ZFS_AC_KERNEL_KTIME + ZFS_AC_KERNEL_TOTALRAM_PAGES_FUNC + ZFS_AC_KERNEL_TOTALHIGH_PAGES + ZFS_AC_KERNEL_KSTRTOUL +diff --git a/include/spl/sys/time.h b/include/spl/sys/time.h +index 312415b7b..56fd725c0 100644 +--- a/include/spl/sys/time.h ++++ b/include/spl/sys/time.h +@@ -105,8 +105,13 @@ gethrestime_sec(void) + static inline hrtime_t + gethrtime(void) + { ++#if defined(HAVE_KTIME_GET_RAW_TS64) ++ struct timespec64 ts; ++ ktime_get_raw_ts64(&ts); ++#else + struct timespec ts; + getrawmonotonic(&ts); ++#endif + return (((hrtime_t)ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec); + } + diff --git a/experimental/zfs/Linux-5.6-compat-time_t-2c3a83701dd1.patch b/experimental/zfs/Linux-5.6-compat-time_t-2c3a83701dd1.patch new file mode 100644 index 000000000..7a97d968f --- /dev/null +++ b/experimental/zfs/Linux-5.6-compat-time_t-2c3a83701dd1.patch @@ -0,0 +1,110 @@ +commit 2c3a83701dd185cadb30db4556256534e2930c7d +Author: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Wed Feb 26 13:18:07 2020 -0800 + + Linux 5.6 compat: time_t + + As part of the Linux kernel's y2038 changes the time_t type has been + fully retired. Callers are now required to use the time64_t type. + + Rather than move to the new type, I've removed the few remaining + places where a time_t is used in the kernel code. They've been + replaced with a uint64_t which is already how ZFS internally + handled these values. + + Going forward we should work towards updating the remaining user + space time_t consumers to the 64-bit interfaces. + + Reviewed-by: Matthew Macy <mmacy@freebsd.org> + Reviewed-by: Tony Hutter <hutter2@llnl.gov> + Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> + Closes #10052 + Closes #10064 + +diff --git a/include/spl/sys/time.h b/include/spl/sys/time.h +index 56fd725c0..4309c300b 100644 +--- a/include/spl/sys/time.h ++++ b/include/spl/sys/time.h +@@ -85,7 +85,7 @@ gethrestime(inode_timespec_t *ts) + #endif + } + +-static inline time_t ++static inline uint64_t + gethrestime_sec(void) + { + #if defined(HAVE_INODE_TIMESPEC64_TIMES) +diff --git a/include/sys/vdev_impl.h b/include/sys/vdev_impl.h +index 4f63e1ae5..b55871a5d 100644 +--- a/include/sys/vdev_impl.h ++++ b/include/sys/vdev_impl.h +@@ -272,7 +272,7 @@ struct vdev { + range_tree_t *vdev_initialize_tree; /* valid while initializing */ + uint64_t vdev_initialize_bytes_est; + uint64_t vdev_initialize_bytes_done; +- time_t vdev_initialize_action_time; /* start and end time */ ++ uint64_t vdev_initialize_action_time; /* start and end time */ + + /* TRIM related */ + boolean_t vdev_trim_exit_wanted; +@@ -293,7 +293,7 @@ struct vdev { + uint64_t vdev_trim_rate; /* requested rate (bytes/sec) */ + uint64_t vdev_trim_partial; /* requested partial TRIM */ + uint64_t vdev_trim_secure; /* requested secure TRIM */ +- time_t vdev_trim_action_time; /* start and end time */ ++ uint64_t vdev_trim_action_time; /* start and end time */ + + /* for limiting outstanding I/Os (initialize and TRIM) */ + kmutex_t vdev_initialize_io_lock; +diff --git a/lib/libspl/include/sys/time.h b/lib/libspl/include/sys/time.h +index 291f2190a..c9f616504 100644 +--- a/lib/libspl/include/sys/time.h ++++ b/lib/libspl/include/sys/time.h +@@ -88,7 +88,7 @@ gethrestime(inode_timespec_t *ts) + ts->tv_nsec = tv.tv_usec * NSEC_PER_USEC; + } + +-static inline time_t ++static inline uint64_t + gethrestime_sec(void) + { + struct timeval tv; +diff --git a/module/zfs/zfs_debug.c b/module/zfs/zfs_debug.c +index a64971d0a..d98463f1b 100644 +--- a/module/zfs/zfs_debug.c ++++ b/module/zfs/zfs_debug.c +@@ -28,7 +28,7 @@ + + typedef struct zfs_dbgmsg { + procfs_list_node_t zdm_node; +- time_t zdm_timestamp; ++ uint64_t zdm_timestamp; + int zdm_size; + char zdm_msg[1]; /* variable length allocation */ + } zfs_dbgmsg_t; +diff --git a/module/zfs/vdev_initialize.c b/module/zfs/vdev_initialize.c +index 3e691c7f5..5899af9fc 100644 +--- a/module/zfs/vdev_initialize.c ++++ b/module/zfs/vdev_initialize.c +@@ -713,7 +713,7 @@ vdev_initialize_restart(vdev_t *vd) + vd->vdev_leaf_zap, VDEV_LEAF_ZAP_INITIALIZE_ACTION_TIME, + sizeof (timestamp), 1, ×tamp); + ASSERT(err == 0 || err == ENOENT); +- vd->vdev_initialize_action_time = (time_t)timestamp; ++ vd->vdev_initialize_action_time = timestamp; + + if (vd->vdev_initialize_state == VDEV_INITIALIZE_SUSPENDED || + vd->vdev_offline) { +diff --git a/module/zfs/vdev_trim.c b/module/zfs/vdev_trim.c +index c7c429cbd..7dec07e3c 100644 +--- a/module/zfs/vdev_trim.c ++++ b/module/zfs/vdev_trim.c +@@ -1051,7 +1051,7 @@ vdev_trim_restart(vdev_t *vd) + vd->vdev_leaf_zap, VDEV_LEAF_ZAP_TRIM_ACTION_TIME, + sizeof (timestamp), 1, ×tamp); + ASSERT(err == 0 || err == ENOENT); +- vd->vdev_trim_action_time = (time_t)timestamp; ++ vd->vdev_trim_action_time = timestamp; + + if (vd->vdev_trim_state == VDEV_TRIM_SUSPENDED || + vd->vdev_offline) { diff --git a/experimental/zfs/Linux-5.6-compat-timestamp_truncate-795699a6cc28.patch b/experimental/zfs/Linux-5.6-compat-timestamp_truncate-795699a6cc28.patch new file mode 100644 index 000000000..deb81347b --- /dev/null +++ b/experimental/zfs/Linux-5.6-compat-timestamp_truncate-795699a6cc28.patch @@ -0,0 +1,131 @@ +commit 795699a6cc28b8f1059397e03d1a86d576bfc7dc +Author: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Thu Feb 6 12:37:25 2020 -0800 + + Linux 5.6 compat: timestamp_truncate() + + The timestamp_truncate() function was added, it replaces the existing + timespec64_trunc() function. This change renames our wrapper function + to be consistent with the upstream name and updates the compatibility + code for older kernels accordingly. + + Reviewed-by: Tony Hutter <hutter2@llnl.gov> + Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> + Closes #9956 + Closes #9961 + +diff --git a/config/kernel-inode-times.m4 b/config/kernel-inode-times.m4 +index 57e7f31fd..8a79c299e 100644 +--- a/config/kernel-inode-times.m4 ++++ b/config/kernel-inode-times.m4 +@@ -1,8 +1,22 @@ +-dnl # +-dnl # 4.18 API change +-dnl # i_atime, i_mtime, and i_ctime changed from timespec to timespec64. +-dnl # + AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_TIMES], [ ++ ++ dnl # ++ dnl # 5.6 API change ++ dnl # timespec64_trunc() replaced by timestamp_truncate() interface. ++ dnl # ++ ZFS_LINUX_TEST_SRC([timestamp_truncate], [ ++ #include <linux/fs.h> ++ ],[ ++ struct timespec64 ts; ++ struct inode ip; ++ ++ ts = timestamp_truncate(ts, &ip); ++ ]) ++ ++ dnl # ++ dnl # 4.18 API change ++ dnl # i_atime, i_mtime, and i_ctime changed from timespec to timespec64. ++ dnl # + ZFS_LINUX_TEST_SRC([inode_times], [ + #include <linux/fs.h> + ],[ +@@ -15,6 +29,15 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_TIMES], [ + ]) + + AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [ ++ AC_MSG_CHECKING([whether timestamp_truncate() exists]) ++ ZFS_LINUX_TEST_RESULT([timestamp_truncate], [ ++ AC_MSG_RESULT(yes) ++ AC_DEFINE(HAVE_INODE_TIMESTAMP_TRUNCATE, 1, ++ [timestamp_truncate() exists]) ++ ],[ ++ AC_MSG_RESULT(no) ++ ]) ++ + AC_MSG_CHECKING([whether inode->i_*time's are timespec64]) + ZFS_LINUX_TEST_RESULT([inode_times], [ + AC_MSG_RESULT(no) +diff --git a/include/sys/zpl.h b/include/sys/zpl.h +index 20a3dc674..ef5a0b842 100644 +--- a/include/sys/zpl.h ++++ b/include/sys/zpl.h +@@ -170,13 +170,14 @@ zpl_dir_emit_dots(struct file *file, zpl_dir_context_t *ctx) + } + #endif /* HAVE_VFS_ITERATE */ + +-/* +- * Linux 4.18, inode times converted from timespec to timespec64. +- */ +-#if defined(HAVE_INODE_TIMESPEC64_TIMES) +-#define zpl_inode_timespec_trunc(ts, gran) timespec64_trunc(ts, gran) ++#if defined(HAVE_INODE_TIMESTAMP_TRUNCATE) ++#define zpl_inode_timestamp_truncate(ts, ip) timestamp_truncate(ts, ip) ++#elif defined(HAVE_INODE_TIMESPEC64_TIMES) ++#define zpl_inode_timestamp_truncate(ts, ip) \ ++ timespec64_trunc(ts, (ip)->i_sb->s_time_gran) + #else +-#define zpl_inode_timespec_trunc(ts, gran) timespec_trunc(ts, gran) ++#define zpl_inode_timestamp_truncate(ts, ip) \ ++ timespec_trunc(ts, (ip)->i_sb->s_time_gran) + #endif + + #endif /* _SYS_ZPL_H */ +diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c +index ec63dbdeb..406cd7ef2 100644 +--- a/module/zfs/zfs_vnops.c ++++ b/module/zfs/zfs_vnops.c +@@ -3444,8 +3444,8 @@ top: + + if (mask & (ATTR_MTIME | ATTR_SIZE)) { + ZFS_TIME_ENCODE(&vap->va_mtime, mtime); +- ZTOI(zp)->i_mtime = zpl_inode_timespec_trunc(vap->va_mtime, +- ZTOI(zp)->i_sb->s_time_gran); ++ ZTOI(zp)->i_mtime = zpl_inode_timestamp_truncate( ++ vap->va_mtime, ZTOI(zp)); + + SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MTIME(zfsvfs), NULL, + mtime, sizeof (mtime)); +@@ -3453,8 +3453,8 @@ top: + + if (mask & (ATTR_CTIME | ATTR_SIZE)) { + ZFS_TIME_ENCODE(&vap->va_ctime, ctime); +- ZTOI(zp)->i_ctime = zpl_inode_timespec_trunc(vap->va_ctime, +- ZTOI(zp)->i_sb->s_time_gran); ++ ZTOI(zp)->i_ctime = zpl_inode_timestamp_truncate(vap->va_ctime, ++ ZTOI(zp)); + SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL, + ctime, sizeof (ctime)); + } +diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c +index e1c6ce7b7..c1b582574 100644 +--- a/module/zfs/zpl_inode.c ++++ b/module/zfs/zpl_inode.c +@@ -382,10 +382,8 @@ zpl_setattr(struct dentry *dentry, struct iattr *ia) + vap->va_mtime = ia->ia_mtime; + vap->va_ctime = ia->ia_ctime; + +- if (vap->va_mask & ATTR_ATIME) { +- ip->i_atime = zpl_inode_timespec_trunc(ia->ia_atime, +- ip->i_sb->s_time_gran); +- } ++ if (vap->va_mask & ATTR_ATIME) ++ ip->i_atime = zpl_inode_timestamp_truncate(ia->ia_atime, ip); + + cookie = spl_fstrans_mark(); + error = -zfs_setattr(ITOZ(ip), vap, 0, cr); diff --git a/experimental/zfs/fix-autoconf-redirection-for-dash.patch b/experimental/zfs/fix-autoconf-redirection-for-dash.patch new file mode 100644 index 000000000..aa6e3becc --- /dev/null +++ b/experimental/zfs/fix-autoconf-redirection-for-dash.patch @@ -0,0 +1,11 @@ +--- a/config/kernel.m4 2020-03-28 09:54:37.851263408 +0000 ++++ b/config/kernel.m4 2020-03-28 09:54:47.004155429 +0000 +@@ -603,7 +603,7 @@ + AC_TRY_COMMAND([ + KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6" + make modules -k -j$TEST_JOBS -C $LINUX_OBJ $ARCH_UM +- M=$PWD/$1 &>$1/build.log]) ++ M=$PWD/$1 >$1/build.log 2>&1]) + AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4]) + ]) + |