diff options
Diffstat (limited to 'sys-fs/zfs-kmod')
-rw-r--r-- | sys-fs/zfs-kmod/Manifest | 19 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_bio_max_segs.patch | 91 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_iov_iter_advance.patch | 40 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_tmpfile.patch | 89 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_userns.patch | 173 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-8.0.4_spl_kmem_cache_slab_limit_16K.patch | 59 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/files/zfs-8.0.4_stream_resume.patch | 33 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild | 17 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-2.0.4-r1.ebuild (renamed from sys-fs/zfs-kmod/zfs-kmod-2.0.4.ebuild) | 42 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-2.1.0_rc7.ebuild (renamed from sys-fs/zfs-kmod/zfs-kmod-2.1.0_rc6.ebuild) | 24 | ||||
-rw-r--r-- | sys-fs/zfs-kmod/zfs-kmod-9999.ebuild | 24 |
11 files changed, 586 insertions, 25 deletions
diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest index cf8f2d2cf26c..4331a049675c 100644 --- a/sys-fs/zfs-kmod/Manifest +++ b/sys-fs/zfs-kmod/Manifest @@ -1,10 +1,17 @@ AUX 0.8.6-copy-builtin.patch 988 BLAKE2B f79add4b341075e3cd98b6aee4bb74b8fadd28b5ee1062f9260c0418909d380cdd2d637b52d4959ec19cafec1e55b1d05cd6bc358fdffbd6dc1b159e9935083d SHA512 af6b73a2d9d1b4e028c9b959950934798f4d048211d6e4a7e94595982ad2dc8bb4befd52122e3fa0890548e192f2f2ae41d877cad057543e940a7c2710c81a23 +AUX zfs-8.0.4_5.12_compat_bio_max_segs.patch 3134 BLAKE2B cfe0d17448f25ec649ca7cf0bb7ee4f2685d09b2fa693b411f31a4035e113627c8be73514b39f2460646b9a556a133afcbfc803675d93d1fd5d93d64d8b4e7b2 SHA512 c8a9893bfee7622fe9ebf61d311fd3701311d3e037cb0d69667b80a7e4d1ddb84e614b3631f2ae768223ea12fafa653f11ed99acdb973b487bdc98e143fe882d +AUX zfs-8.0.4_5.12_compat_iov_iter_advance.patch 1357 BLAKE2B c32c94c233cc15f1db4166d293b7e0030f51c9ba6ba185293a2c068419a64c46288244e6096f69f55e5bd19006729b080cb95966519eb8db142a494d9f147878 SHA512 85d6cae52d088789930e130b5f62f9e9955e7b2e3e60f8624cf9cfe8b4b032a951ea605dbff5ed8164ec5eef66efa119238ddb9e5c64351b81dccebef94b8787 +AUX zfs-8.0.4_5.12_compat_tmpfile.patch 3013 BLAKE2B b1012123a6d9ddd03b7db83075447eba99c8fb4e3bf4f4e8a54d9defe2c4e6b752bda70d8512a8da68f509fc832acbaf2eb73c6673123553ac38c99095d7f872 SHA512 a981aa41fdf4c377f031d312c3f480152e80976f3ffa9e85f07918c599e3d5d70fb8310a0f1da0a0ebadf123408993134ef599d2750e16ea82e16dd060f198f8 +AUX zfs-8.0.4_5.12_compat_userns.patch 5612 BLAKE2B 556d3850a2c7f74370702ad354f64424170682f6499b6a5e1a58c45e20ddb082109a541b8613b815820569aeab5c322e180d8f0d0a6cea4799e11dd9afbe464e SHA512 b80f0e836db9008d5d0779ca8640c6cf0f6798cde66913391083236402e70907809c7f64f70008e53d5517e764c3f5678fadeb538ef30c98fc1f90e863deb400 +AUX zfs-8.0.4_spl_kmem_cache_slab_limit_16K.patch 2770 BLAKE2B f56051e4b2411fb7864989db6dd0dc56b09365b9326f131dc7d79d050ac18668d1c1e403c5d51471a0b65bf53954bf6f03b0c8b2b497b79cbc2b36abf58b144e SHA512 edf2be80a5d331181ffc3cfe32eaed20975181d63f9a68f1cea006f7d12f946c7e04003fc5062d34eef81079ae777e50e0ee533707b20a49e2411e3286d6c140 +AUX zfs-8.0.4_stream_resume.patch 1263 BLAKE2B 4454568cfcafa9b6b7ba6de94df728da349f1dff9803c21fc4d9613af17b65dc59ba2c7cf9584d1456cf454e4ba1bf9a9467e0b181d097861d649ffd32461bf4 SHA512 074b633a39930030ca45d49d1ea0c97a8e70a7b63feaabb010e8fc724940ae5989c1feae67affb03b7d6aafe68537afea032688f4b57ec2663848aaa93340710 DIST zfs-0.8.6.tar.gz 9295260 BLAKE2B 45424d710aaf75a05f766ae523ae157a24b5cbdcefe72a59e4cede81e42f7a92ae7f01150388437b78cd49f3d28b9664599f2a624516e6b3f1073497194a99f2 SHA512 626b172554f39a5c70f6ea5c599a92fae52534590d1b0273de2bbfc3676d29dff0eade8ca17e5f179a59870c12bc758fb53b7900f8a1fdbdef3a9161b93f9cce DIST zfs-2.0.4.tar.gz 13123872 BLAKE2B 7e4780092c0a87d5d187cd5734ddc736574db80b500f155287640ef2230e09335cc9b6b26ec1b7d8ab1b7942673ea49a3007a81da372a6d2ac36f3908913045c SHA512 1dda92d424372bce7020f5215545485eae69211b6f0fb6bea3c7c22efac76c6a2662f0dd14a03f723b6a6fe73b1228ecca211a4034b86cf885bcadf38ba0dc6b -DIST zfs-2.1.0-rc6.tar.gz 34777294 BLAKE2B 0080b03a9cf9717ae2bc7674e340dffafd923467368d8941df9be5a21f081e88745297e1a8b2ac5059e9f346949bbeb759a5fc8bcdb60c3be49b0645389ec8b1 SHA512 696d525c1c738a508d04366f8ffd0142aebe4498efbf129c9d38fa7c67dbec83554f55a2c4a5d7647a03ca0df173c2720fe85edbc859195f4ca19e04d2adf143 -DIST zfs-2.1.0-rc6.tar.gz.asc 195 BLAKE2B a1267b8faffc75ac70082e261c6053b2070cbad014c92051ebc82af56b21bbe2e72e01e44c0701ed255a3201330bb56b5e1a72e12c1ae9f15f72883b53c17ec6 SHA512 afc0eb839de6b0b21b3d781dd74dce9f6f668b7b9fc079ea764666e28d4d3228b8a80641b6d0084851bffedfc3406dc0f829242f6b4247d192f554ba45ce3a4c -EBUILD zfs-kmod-0.8.6.ebuild 4796 BLAKE2B ddb58b4223966078cd38b461d9dcc48f485a240ffc4b154abc58805f1c2f5d750d07854da9e1f736c103142cab13e2667b1d526c98782b821208a93815b4b368 SHA512 7dd5cba7330973fd1afc588d2673e958aabeaa9af80e8df09eca35283cae4fda228d32d7a300ec8732e30a32ad6bf5fb6867f34bcad9c7975290d8014fdfcfdf -EBUILD zfs-kmod-2.0.4.ebuild 4480 BLAKE2B 3351d47b9fe97cbe8de7e12f86d0ee8a66c83094ffc66fe9d551f2bbd83a5a935580f8bdf3a55811b7e554d3a24b9c60f798bdd528ecf25321137fd5b62ef981 SHA512 dd42188466bfbec8af4ac9a968cb15f82b691bb1d5ea09bcd1cc9e86d6b7eed1ff6e1cd8fdc6c121c5be488efc1cb225cb024e3b2b701e7dc7325f888554755f -EBUILD zfs-kmod-2.1.0_rc6.ebuild 4803 BLAKE2B 9a43d72668c6dd3093baa138f5c9d76f0fb891fe80b0523898be43cbb102790a0e779cf84cd1dd19ba65a31ed39113e2fdc795d86d927d93b9153905cc16fb00 SHA512 410f7ff768cbafb95bef27ef8d5c8f31daa6c8c37bb990978dbf49406be8a4273e1492af5afca1aa579ae4fe4c76144dd5d9a22ad3d158713816e9685b84b32f -EBUILD zfs-kmod-9999.ebuild 4803 BLAKE2B 9a43d72668c6dd3093baa138f5c9d76f0fb891fe80b0523898be43cbb102790a0e779cf84cd1dd19ba65a31ed39113e2fdc795d86d927d93b9153905cc16fb00 SHA512 410f7ff768cbafb95bef27ef8d5c8f31daa6c8c37bb990978dbf49406be8a4273e1492af5afca1aa579ae4fe4c76144dd5d9a22ad3d158713816e9685b84b32f +DIST zfs-2.1.0-rc7.tar.gz 34800406 BLAKE2B a645c3e19f521a7abb606cbcd619ea019abeb7810bd6476ecddcd76c7c801d6f1e3f197d49199eac72497db5c529b22bcd605b2e7ec2c236aec5216dc99b7dc1 SHA512 4e1cb1cc83454d92cac58110c219fca28dcf8361a5ea27dca955a5c88434b6e9ccd68892d93bf14d773056760f1907e004e65cc5d653308dd8996692ecba61f1 +DIST zfs-2.1.0-rc7.tar.gz.asc 195 BLAKE2B b772bba2f64bec51f11b5c51564a1449cd37d5e8e5c90eee1eb5c357193cab187bdeceef299c95622aed9c03601c1b5d67a941de12003c01e0af9ad68e82bfa2 SHA512 6c48eeab7658db1e9bac54da2f73087b1a58046504c507c94e58478f03f3b37336af254947964dbf9383575dc2cb3019640c7286ab0dfa5d5d9f55df96b34864 +DIST zfs-8.0.4_5.12_compat_idmapped_mounts.patch 41410 BLAKE2B 49724351c5a8e6ffa66762d5aac84ad89a3d04022d086d9f37ccd616b3e8e95852197b5333bdeeeab54fc51516d8254d0138a4422cc66214bb602e5ed72bbabf SHA512 1554d74a7024c106a3f4814895a64914f2e3d627f7edff3c8f415b419c6a596454862f8c0984a6e2f96e340851f1a9222a4c472ebd6d5db7dc0aa108dc2dca6c +EBUILD zfs-kmod-0.8.6.ebuild 5334 BLAKE2B abaa4b20899db464246d9c445ba55d938ba1982a2686a2c6b22fcc213e76551d2a28a59709760dd5e15af6cfdc8e4999713ae4d1efd3275c02a85f1dfc5b3275 SHA512 f67b1c4483f2a985256c18dcaf232c47219726f67c9fa95b184be6e608dc997b2beab18bd5863d32afcc92da0bad5c3ef8337a8878cf060d45b3931e8e736b77 +EBUILD zfs-kmod-2.0.4-r1.ebuild 5500 BLAKE2B 00a6b354c212eb2435588480e931aa343f37060e9d37a898b2bee95cb8a0760e348b10e92b138f0b7d06819d96433b3f94e4e4c0ae99af76d0902d765034053a SHA512 f97ee0af77cc8a7ed932984dd8d2709293f7df2f438806647ffbaa3edc5de0c9309e6340cb5912e95840bf3b20d6a8cb06a15726c107b02e3a89ceca5ee2a63f +EBUILD zfs-kmod-2.1.0_rc7.ebuild 5372 BLAKE2B 98ce65e9b1196d12763608697436fe2b02790f2e987370bb4b9ad2f312f6a723a7a425e64aa31e447ccc7d80581ca97e47348b3ec007fe66b0ff0f334c539cdc SHA512 b121a44505341681c7b3f2de8bf03e3135e5f5a55aa71f6010f91610f14d03ec606bf6c7dfb018198c4fe1985824ac5478a6f1cf2e16a7e0c3a2795a177e95bf +EBUILD zfs-kmod-9999.ebuild 5372 BLAKE2B 98ce65e9b1196d12763608697436fe2b02790f2e987370bb4b9ad2f312f6a723a7a425e64aa31e447ccc7d80581ca97e47348b3ec007fe66b0ff0f334c539cdc SHA512 b121a44505341681c7b3f2de8bf03e3135e5f5a55aa71f6010f91610f14d03ec606bf6c7dfb018198c4fe1985824ac5478a6f1cf2e16a7e0c3a2795a177e95bf MISC metadata.xml 548 BLAKE2B 0245ac0b73ed129ce2df41358814d46749fab0463a03fceb643010629cd522460e84c5b8c0247f499adf4ed2e781e0d6f6857a3c6be4f4fb206eeabba158e86c SHA512 2b98b289369d875c5ff89825590a98c9764a1b716df1b79c852dbb833f4f02d5c66782f43084a1acde11a0ba2cb9ef2956b35c10881f77ec92d6749566276e6b diff --git a/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_bio_max_segs.patch b/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_bio_max_segs.patch new file mode 100644 index 000000000000..33f9a344e2f2 --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_bio_max_segs.patch @@ -0,0 +1,91 @@ +From 77352db228c07ce8ba50478b9029820ca69c6c1b Mon Sep 17 00:00:00 2001 +From: Coleman Kane <ckane@colemankane.org> +Date: Sat, 20 Mar 2021 01:33:42 -0400 +Subject: [PATCH] Linux 5.12 update: bio_max_segs() replaces BIO_MAX_PAGES + +The BIO_MAX_PAGES macro is being retired in favor of a bio_max_segs() +function that implements the typical MIN(x,y) logic used throughout the +kernel for bounding the allocation, and also the new implementation is +intended to be signed-safe (which the former was not). + +Reviewed-by: Tony Hutter <hutter2@llnl.gov> +Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> +Signed-off-by: Coleman Kane <ckane@colemankane.org> +Closes #11765 +(cherry picked from commit ffd6978ef59cfe2773e984bf03de2f0b93b03f5c) +Signed-off-by: Jonathon Fernyhough <jonathon@m2x.dev> +--- + config/kernel-bio_max_segs.m4 | 23 +++++++++++++++++++++++ + config/kernel.m4 | 2 ++ + module/os/linux/zfs/vdev_disk.c | 5 +++++ + 3 files changed, 30 insertions(+) + create mode 100644 config/kernel-bio_max_segs.m4 + +diff --git a/config/kernel-bio_max_segs.m4 b/config/kernel-bio_max_segs.m4 +new file mode 100644 +index 00000000000..a90d75455c1 +--- /dev/null ++++ b/config/kernel-bio_max_segs.m4 +@@ -0,0 +1,23 @@ ++dnl # ++dnl # 5.12 API change removes BIO_MAX_PAGES in favor of bio_max_segs() ++dnl # which will handle the logic of setting the upper-bound to a ++dnl # BIO_MAX_PAGES, internally. ++dnl # ++AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS], [ ++ ZFS_LINUX_TEST_SRC([bio_max_segs], [ ++ #include <linux/bio.h> ++ ],[ ++ bio_max_segs(1); ++ ]) ++]) ++ ++AC_DEFUN([ZFS_AC_KERNEL_BIO_MAX_SEGS], [ ++ AC_MSG_CHECKING([whether bio_max_segs() exists]) ++ ZFS_LINUX_TEST_RESULT([bio_max_segs], [ ++ AC_MSG_RESULT(yes) ++ ++ AC_DEFINE([HAVE_BIO_MAX_SEGS], 1, [bio_max_segs() is implemented]) ++ ],[ ++ AC_MSG_RESULT(no) ++ ]) ++]) +diff --git a/config/kernel.m4 b/config/kernel.m4 +index 51c7fb926ec..b8d53490a4a 100644 +--- a/config/kernel.m4 ++++ b/config/kernel.m4 +@@ -127,6 +127,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ + ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR_USERNS + ZFS_AC_KERNEL_SRC_MKNOD + ZFS_AC_KERNEL_SRC_SYMLINK ++ ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS + + AC_MSG_CHECKING([for available kernel interfaces]) + ZFS_LINUX_TEST_COMPILE_ALL([kabi]) +@@ -227,6 +228,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ + ZFS_AC_KERNEL_GENERIC_FILLATTR_USERNS + ZFS_AC_KERNEL_MKNOD + ZFS_AC_KERNEL_SYMLINK ++ ZFS_AC_KERNEL_BIO_MAX_SEGS + ]) + + dnl # +diff --git a/module/os/linux/zfs/vdev_disk.c b/module/os/linux/zfs/vdev_disk.c +index 08c33313407..aaaf4105979 100644 +--- a/module/os/linux/zfs/vdev_disk.c ++++ b/module/os/linux/zfs/vdev_disk.c +@@ -593,9 +593,14 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio, + } + + /* bio_alloc() with __GFP_WAIT never returns NULL */ ++#ifdef HAVE_BIO_MAX_SEGS ++ dr->dr_bio[i] = bio_alloc(GFP_NOIO, bio_max_segs( ++ abd_nr_pages_off(zio->io_abd, bio_size, abd_offset))); ++#else + dr->dr_bio[i] = bio_alloc(GFP_NOIO, + MIN(abd_nr_pages_off(zio->io_abd, bio_size, abd_offset), + BIO_MAX_PAGES)); ++#endif + if (unlikely(dr->dr_bio[i] == NULL)) { + vdev_disk_dio_free(dr); + return (SET_ERROR(ENOMEM)); diff --git a/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_iov_iter_advance.patch b/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_iov_iter_advance.patch new file mode 100644 index 000000000000..95ecda34652c --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_iov_iter_advance.patch @@ -0,0 +1,40 @@ +From 3e0bc63e1b0ca03493b936e92e871ca7ae451a0a Mon Sep 17 00:00:00 2001 +From: Rich Ercolani <214141+rincebrain@users.noreply.github.com> +Date: Tue, 1 Jun 2021 14:58:08 -0400 +Subject: [PATCH] Remove iov_iter_advance() for iter_write + +The additional iter advance is incorrect, as copy_from_iter() has +already done the right thing. This will result in the following +warning being printed to the console as of the 5.12 kernel. + + Attempted to advance past end of bvec iter + +This change should have been included with #11378 when a +similar change was made on the read side. + +Suggested-by: @siebenmann +Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> +Signed-off-by: Rich Ercolani <rincebrain@gmail.com> +Issue #11378 +Closes #12041 +Closes #12155 +(cherry picked from commit 3f81aba7668143c6ca6fc44983d4c880606dea8f) +Signed-off-by: Jonathon Fernyhough <jonathon@m2x.dev> +--- + module/os/linux/zfs/zpl_file.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c +index 08bf97ff338..e20c1dd413c 100644 +--- a/module/os/linux/zfs/zpl_file.c ++++ b/module/os/linux/zfs/zpl_file.c +@@ -342,9 +342,6 @@ zpl_iter_write(struct kiocb *kiocb, struct iov_iter *from) + ssize_t wrote = count - uio.uio_resid; + kiocb->ki_pos += wrote; + +- if (wrote > 0) +- iov_iter_advance(from, wrote); +- + return (wrote); + } + diff --git a/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_tmpfile.patch b/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_tmpfile.patch new file mode 100644 index 000000000000..08acee821489 --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_tmpfile.patch @@ -0,0 +1,89 @@ +From 6eced028dbbc2a44e32c4c0a76234ac2da9a365a Mon Sep 17 00:00:00 2001 +From: Rich Ercolani <214141+rincebrain@users.noreply.github.com> +Date: Thu, 20 May 2021 19:02:36 -0400 +Subject: [PATCH] Update tmpfile() existence detection + +Linux changed the tmpfile() signature again in torvalds/linux@6521f89, +which in turn broke our HAVE_TMPFILE detection in configure. + +Update that macro to include the new case, and change the signature of +zpl_tmpfile as appropriate. + +Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> +Signed-off-by: Rich Ercolani <rincebrain@gmail.com> +Closes: #12060 +Closes: #12087 +--- + config/kernel-tmpfile.m4 | 28 ++++++++++++++++++++++++---- + module/os/linux/zfs/zpl_inode.c | 5 +++++ + 2 files changed, 29 insertions(+), 4 deletions(-) + +diff --git a/config/kernel-tmpfile.m4 b/config/kernel-tmpfile.m4 +index f510bfe6ba0..45c2e6ceea5 100644 +--- a/config/kernel-tmpfile.m4 ++++ b/config/kernel-tmpfile.m4 +@@ -3,23 +3,43 @@ dnl # 3.11 API change + dnl # Add support for i_op->tmpfile + dnl # + AC_DEFUN([ZFS_AC_KERNEL_SRC_TMPFILE], [ +- ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [ ++ dnl # ++ dnl # 5.11 API change ++ dnl # add support for userns parameter to tmpfile ++ dnl # ++ ZFS_LINUX_TEST_SRC([inode_operations_tmpfile_userns], [ + #include <linux/fs.h> +- int tmpfile(struct inode *inode, struct dentry *dentry, ++ int tmpfile(struct user_namespace *userns, ++ struct inode *inode, struct dentry *dentry, + umode_t mode) { return 0; } + static struct inode_operations + iops __attribute__ ((unused)) = { + .tmpfile = tmpfile, + }; + ],[]) ++ ZFS_LINUX_TEST_SRC([inode_operations_tmpfile], [ ++ #include <linux/fs.h> ++ int tmpfile(struct inode *inode, struct dentry *dentry, ++ umode_t mode) { return 0; } ++ static struct inode_operations ++ iops __attribute__ ((unused)) = { ++ .tmpfile = tmpfile, ++ }; ++ ],[]) + ]) + + AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [ + AC_MSG_CHECKING([whether i_op->tmpfile() exists]) +- ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [ ++ ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_userns], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) ++ AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns]) + ],[ +- AC_MSG_RESULT(no) ++ ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [ ++ AC_MSG_RESULT(yes) ++ AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists]) ++ ],[ ++ AC_MSG_RESULT(no) ++ ]) + ]) + ]) +diff --git a/module/os/linux/zfs/zpl_inode.c b/module/os/linux/zfs/zpl_inode.c +index 364b9fbef24..ab0373ef9ba 100644 +--- a/module/os/linux/zfs/zpl_inode.c ++++ b/module/os/linux/zfs/zpl_inode.c +@@ -218,7 +218,12 @@ zpl_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, + + #ifdef HAVE_TMPFILE + static int ++#ifdef HAVE_TMPFILE_USERNS ++zpl_tmpfile(struct user_namespace *userns, struct inode *dir, ++ struct dentry *dentry, umode_t mode) ++#else + zpl_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) ++#endif + { + cred_t *cr = CRED(); + struct inode *ip; diff --git a/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_userns.patch b/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_userns.patch new file mode 100644 index 000000000000..1d8530ec8c6c --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-8.0.4_5.12_compat_userns.patch @@ -0,0 +1,173 @@ +From b3f8b103cb3a4bbb7ad41f6faf630be7baa4f585 Mon Sep 17 00:00:00 2001 +From: Rich Ercolani <214141+rincebrain@users.noreply.github.com> +Date: Thu, 27 May 2021 11:55:49 -0400 +Subject: [PATCH] Bend zpl_set_acl to permit the new userns* parameter + +Just like #12087, the set_acl signature changed with all the bolted-on +*userns parameters, which disabled set_acl usage, and caused #12076. + +Turn zpl_set_acl into zpl_set_acl and zpl_set_acl_impl, and add a +new configure test for the new version. + +Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> +Signed-off-by: Rich Ercolani <rincebrain@gmail.com> +Closes #12076 +Closes #12093 +--- + config/kernel-acl.m4 | 25 +++++++++++++++++++++-- + include/os/linux/zfs/sys/zpl.h | 5 +++++ + module/os/linux/zfs/zpl_xattr.c | 35 ++++++++++++++++++++++----------- + 3 files changed, 51 insertions(+), 14 deletions(-) + +diff --git a/config/kernel-acl.m4 b/config/kernel-acl.m4 +index e02ce665323..c6da4df24eb 100644 +--- a/config/kernel-acl.m4 ++++ b/config/kernel-acl.m4 +@@ -189,7 +189,22 @@ dnl # + dnl # 3.14 API change, + dnl # Check if inode_operations contains the function set_acl + dnl # ++dnl # 5.12 API change, ++dnl # set_acl() added a user_namespace* parameter first ++dnl # + AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [ ++ ZFS_LINUX_TEST_SRC([inode_operations_set_acl_userns], [ ++ #include <linux/fs.h> ++ ++ int set_acl_fn(struct user_namespace *userns, ++ struct inode *inode, struct posix_acl *acl, ++ int type) { return 0; } ++ ++ static const struct inode_operations ++ iops __attribute__ ((unused)) = { ++ .set_acl = set_acl_fn, ++ }; ++ ],[]) + ZFS_LINUX_TEST_SRC([inode_operations_set_acl], [ + #include <linux/fs.h> + +@@ -205,11 +220,17 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [ + + AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [ + AC_MSG_CHECKING([whether iops->set_acl() exists]) +- ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [ ++ ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists]) ++ AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args]) + ],[ +- AC_MSG_RESULT(no) ++ ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [ ++ AC_MSG_RESULT(yes) ++ AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args]) ++ ],[ ++ AC_MSG_RESULT(no) ++ ]) + ]) + ]) + +diff --git a/include/os/linux/zfs/sys/zpl.h b/include/os/linux/zfs/sys/zpl.h +index 21825d1f378..54f3fa0fdb0 100644 +--- a/include/os/linux/zfs/sys/zpl.h ++++ b/include/os/linux/zfs/sys/zpl.h +@@ -63,7 +63,12 @@ extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip, + const struct qstr *qstr); + #if defined(CONFIG_FS_POSIX_ACL) + #if defined(HAVE_SET_ACL) ++#if defined(HAVE_SET_ACL_USERNS) ++extern int zpl_set_acl(struct user_namespace *userns, struct inode *ip, ++ struct posix_acl *acl, int type); ++#else + extern int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type); ++#endif /* HAVE_SET_ACL_USERNS */ + #endif /* HAVE_SET_ACL */ + extern struct posix_acl *zpl_get_acl(struct inode *ip, int type); + extern int zpl_init_acl(struct inode *ip, struct inode *dir); +diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c +index 5e35f90df85..89ba9de14f6 100644 +--- a/module/os/linux/zfs/zpl_xattr.c ++++ b/module/os/linux/zfs/zpl_xattr.c +@@ -926,11 +926,8 @@ xattr_handler_t zpl_xattr_security_handler = { + * attribute implemented by filesystems in the kernel." - xattr(7) + */ + #ifdef CONFIG_FS_POSIX_ACL +-#ifndef HAVE_SET_ACL +-static +-#endif +-int +-zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type) ++static int ++zpl_set_acl_impl(struct inode *ip, struct posix_acl *acl, int type) + { + char *name, *value = NULL; + int error = 0; +@@ -1002,6 +999,19 @@ zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type) + return (error); + } + ++#ifdef HAVE_SET_ACL ++int ++#ifdef HAVE_SET_ACL_USERNS ++zpl_set_acl(struct user_namespace *userns, struct inode *ip, ++ struct posix_acl *acl, int type) ++#else ++zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type) ++#endif /* HAVE_SET_ACL_USERNS */ ++{ ++ return (zpl_set_acl_impl(ip, acl, type)); ++} ++#endif /* HAVE_SET_ACL */ ++ + struct posix_acl * + zpl_get_acl(struct inode *ip, int type) + { +@@ -1083,7 +1093,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir) + umode_t mode; + + if (S_ISDIR(ip->i_mode)) { +- error = zpl_set_acl(ip, acl, ACL_TYPE_DEFAULT); ++ error = zpl_set_acl_impl(ip, acl, ACL_TYPE_DEFAULT); + if (error) + goto out; + } +@@ -1093,8 +1103,10 @@ zpl_init_acl(struct inode *ip, struct inode *dir) + if (error >= 0) { + ip->i_mode = mode; + zfs_mark_inode_dirty(ip); +- if (error > 0) +- error = zpl_set_acl(ip, acl, ACL_TYPE_ACCESS); ++ if (error > 0) { ++ error = zpl_set_acl_impl(ip, acl, ++ ACL_TYPE_ACCESS); ++ } + } + } + out: +@@ -1121,7 +1133,7 @@ zpl_chmod_acl(struct inode *ip) + + error = __posix_acl_chmod(&acl, GFP_KERNEL, ip->i_mode); + if (!error) +- error = zpl_set_acl(ip, acl, ACL_TYPE_ACCESS); ++ error = zpl_set_acl_impl(ip, acl, ACL_TYPE_ACCESS); + + zpl_posix_acl_release(acl); + +@@ -1250,8 +1262,7 @@ __zpl_xattr_acl_set_access(struct inode *ip, const char *name, + } else { + acl = NULL; + } +- +- error = zpl_set_acl(ip, acl, type); ++ error = zpl_set_acl_impl(ip, acl, type); + zpl_posix_acl_release(acl); + + return (error); +@@ -1291,7 +1302,7 @@ __zpl_xattr_acl_set_default(struct inode *ip, const char *name, + acl = NULL; + } + +- error = zpl_set_acl(ip, acl, type); ++ error = zpl_set_acl_impl(ip, acl, type); + zpl_posix_acl_release(acl); + + return (error); diff --git a/sys-fs/zfs-kmod/files/zfs-8.0.4_spl_kmem_cache_slab_limit_16K.patch b/sys-fs/zfs-kmod/files/zfs-8.0.4_spl_kmem_cache_slab_limit_16K.patch new file mode 100644 index 000000000000..3448f76a8012 --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-8.0.4_spl_kmem_cache_slab_limit_16K.patch @@ -0,0 +1,59 @@ +From 783784582225e8ddfbf07993d9fc278bf08025c5 Mon Sep 17 00:00:00 2001 +From: Brian Behlendorf <behlendorf1@llnl.gov> +Date: Thu, 3 Jun 2021 13:37:45 -0700 +Subject: [PATCH] Linux: Set spl_kmem_cache_slab_limit when page size !4K + +For small objects the kernel's slab implementation is very fast and +space efficient. However, as the allocation size increases to +require multiple pages performance suffers. The SPL kmem cache +allocator was designed to better handle these large allocation +sizes. Therefore, on Linux the kmem_cache_* compatibility wrappers +prefer to use the kernel's slab allocator for small objects and +the custom SPL kmem cache allocator for larger objects. + +This logic was effectively disabled for all architectures using +a non-4K page size which caused all kmem caches to only use the +SPL implementation. Functionally this is fine, but the SPL code +which calculates the target number of objects per-slab does not +take in to account that __vmalloc() always returns page-aligned +memory. This can result in a massive amount of wasted space when +allocating tiny objects on a platform using large pages (64k). + +To resolve this issue we set the spl_kmem_cache_slab_limit cutoff +to 16K for all architectures. + +This particular change does not attempt to update the logic used +to calculate the optimal number of pages per slab. This remains +an issue which should be addressed in a future change. + +Reviewed-by: Matthew Ahrens <mahrens@delphix.com> +Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com> +Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> +Closes #12152 +Closes #11429 +Closes #11574 +Closes #12150 +--- + module/os/linux/spl/spl-kmem-cache.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/module/os/linux/spl/spl-kmem-cache.c b/module/os/linux/spl/spl-kmem-cache.c +index 3699b6a159a..2151ef008fd 100644 +--- a/module/os/linux/spl/spl-kmem-cache.c ++++ b/module/os/linux/spl/spl-kmem-cache.c +@@ -100,13 +100,10 @@ MODULE_PARM_DESC(spl_kmem_cache_max_size, "Maximum size of slab in MB"); + * For small objects the Linux slab allocator should be used to make the most + * efficient use of the memory. However, large objects are not supported by + * the Linux slab and therefore the SPL implementation is preferred. A cutoff +- * of 16K was determined to be optimal for architectures using 4K pages. ++ * of 16K was determined to be optimal for architectures using 4K pages and ++ * to also work well on architecutres using larger 64K page sizes. + */ +-#if PAGE_SIZE == 4096 + unsigned int spl_kmem_cache_slab_limit = 16384; +-#else +-unsigned int spl_kmem_cache_slab_limit = 0; +-#endif + module_param(spl_kmem_cache_slab_limit, uint, 0644); + MODULE_PARM_DESC(spl_kmem_cache_slab_limit, + "Objects less than N bytes use the Linux slab"); diff --git a/sys-fs/zfs-kmod/files/zfs-8.0.4_stream_resume.patch b/sys-fs/zfs-kmod/files/zfs-8.0.4_stream_resume.patch new file mode 100644 index 000000000000..196fab65f4ab --- /dev/null +++ b/sys-fs/zfs-kmod/files/zfs-8.0.4_stream_resume.patch @@ -0,0 +1,33 @@ +From ee2a9d2c771657168652e058477b81389c662b5e Mon Sep 17 00:00:00 2001 +From: Paul Zuchowski <31706010+PaulZ-98@users.noreply.github.com> +Date: Fri, 14 May 2021 00:46:14 -0400 +Subject: [PATCH] Fix dmu_recv_stream test for resumable + +Use dsl_dataset_has_resume_receive_state() +not dsl_dataset_is_zapified() to check if +stream is resumable. + +Reviewed-by: Matthew Ahrens <mahrens@delphix.com> +Reviewed-by: Alek Pinchuk <apinchuk@axcient.com> +Reviewed-by: Ryan Moeller <ryan@ixsystems.com> +Signed-off-by: Paul Zuchowski <pzuchowski@datto.com> +Closes #12034 +--- + module/zfs/dmu_recv.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c +index b5414749f7f..f44b397853f 100644 +--- a/module/zfs/dmu_recv.c ++++ b/module/zfs/dmu_recv.c +@@ -2878,8 +2878,8 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, offset_t *voffp) + int err = 0; + struct receive_writer_arg *rwa = kmem_zalloc(sizeof (*rwa), KM_SLEEP); + +- if (dsl_dataset_is_zapified(drc->drc_ds)) { +- uint64_t bytes; ++ if (dsl_dataset_has_resume_receive_state(drc->drc_ds)) { ++ uint64_t bytes = 0; + (void) zap_lookup(drc->drc_ds->ds_dir->dd_pool->dp_meta_objset, + drc->drc_ds->ds_object, DS_FIELD_RESUME_BYTES, + sizeof (bytes), 1, &bytes); diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild index f63c737f2af0..68776243c4fb 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-0.8.6.ebuild @@ -19,7 +19,7 @@ else fi LICENSE="CDDL debug? ( GPL-2+ )" -SLOT="0" +SLOT="0/${PVR}" IUSE="custom-cflags debug +rootfs" DEPEND="" @@ -33,10 +33,25 @@ BDEPEND=" virtual/awk " +# PDEPEND in this form is needed to trick portage suggest +# enabling dist-kernel if only 1 package have it set +PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )" + RESTRICT="debug? ( strip ) test" DOCS=( AUTHORS COPYRIGHT META README.md ) +pkg_pretend() { + use rootfs || return 0 + + if has_version virtual/dist-kernel && ! use dist-kernel; then + ewarn "You have virtual/dist-kernel installed, but" + ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}" + ewarn "It's recommended to globally enable dist-kernel USE flag" + ewarn "to auto-trigger initrd rebuilds with kernel updates" + fi +} + # https://github.com/openzfs/zfs/pull/11371 PATCHES=( "${FILESDIR}/${PV}-copy-builtin.patch" ) diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.0.4.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.0.4-r1.ebuild index 32715c6f6a94..18391c3ffa91 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-2.0.4.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-2.0.4-r1.ebuild @@ -13,14 +13,15 @@ if [[ ${PV} == "9999" ]]; then EGIT_REPO_URI="https://github.com/openzfs/zfs.git" else MY_PV="${PV/_rc/-rc}" - SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz" + SRC_URI="https://github.com/openzfs/zfs/releases/download/zfs-${MY_PV}/zfs-${MY_PV}.tar.gz + https://github.com/openzfs/zfs/commit/f315d9a3ff3cc0b81c99dd9be5878a55d2e98d8e.patch -> zfs-8.0.4_5.12_compat_idmapped_mounts.patch" KEYWORDS="~amd64 ~arm64 ~ppc64" S="${WORKDIR}/zfs-${PV%_rc?}" - ZFS_KERNEL_COMPAT="5.11" + ZFS_KERNEL_COMPAT="5.12" fi LICENSE="CDDL MIT debug? ( GPL-2+ )" -SLOT="0" +SLOT="0/${PVR}" IUSE="custom-cflags debug +rootfs" DEPEND="" @@ -34,10 +35,35 @@ BDEPEND=" virtual/awk " +# PDEPEND in this form is needed to trick portage suggest +# enabling dist-kernel if only 1 package have it set +PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )" + RESTRICT="debug? ( strip ) test" DOCS=( AUTHORS COPYRIGHT META README.md ) +pkg_pretend() { + use rootfs || return 0 + + if has_version virtual/dist-kernel && ! use dist-kernel; then + ewarn "You have virtual/dist-kernel installed, but" + ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}" + ewarn "It's recommended to globally enable dist-kernel USE flag" + ewarn "to auto-trigger initrd rebuilds with kernel updates" + fi +} + +PATCHES=( + "${DISTDIR}"/zfs-8.0.4_5.12_compat_idmapped_mounts.patch + "${FILESDIR}"/zfs-8.0.4_5.12_compat_bio_max_segs.patch + "${FILESDIR}"/zfs-8.0.4_5.12_compat_tmpfile.patch + "${FILESDIR}"/zfs-8.0.4_5.12_compat_userns.patch + "${FILESDIR}"/zfs-8.0.4_5.12_compat_iov_iter_advance.patch + "${FILESDIR}"/zfs-8.0.4_stream_resume.patch + "${FILESDIR}"/zfs-8.0.4_spl_kmem_cache_slab_limit_16K.patch +) + pkg_setup() { CONFIG_CHECK=" !DEBUG_LOCK_ALLOC @@ -81,13 +107,9 @@ pkg_setup() { src_prepare() { default - - if [[ ${PV} == "9999" ]]; then - eautoreconf - else - # Set module revision number - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" - fi + eautoreconf + # Set module revision number + sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" } src_configure() { diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.1.0_rc6.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.1.0_rc7.ebuild index f57ff9699ac8..27cf80ed4300 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-2.1.0_rc6.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-2.1.0_rc7.ebuild @@ -27,7 +27,7 @@ else fi LICENSE="CDDL MIT debug? ( GPL-2+ )" -SLOT="0" +SLOT="0/${PVR}" IUSE="custom-cflags debug +rootfs" RDEPEND="${DEPEND} @@ -43,10 +43,25 @@ if [[ ${PV} != "9999" ]] ; then BDEPEND+=" verify-sig? ( app-crypt/openpgp-keys-openzfs )" fi +# PDEPEND in this form is needed to trick portage suggest +# enabling dist-kernel if only 1 package have it set +PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )" + RESTRICT="debug? ( strip ) test" DOCS=( AUTHORS COPYRIGHT META README.md ) +pkg_pretend() { + use rootfs || return 0 + + if has_version virtual/dist-kernel && ! use dist-kernel; then + ewarn "You have virtual/dist-kernel installed, but" + ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}" + ewarn "It's recommended to globally enable dist-kernel USE flag" + ewarn "to auto-trigger initrd rebuilds with kernel updates" + fi +} + pkg_setup() { CONFIG_CHECK=" !DEBUG_LOCK_ALLOC @@ -91,9 +106,10 @@ pkg_setup() { src_prepare() { default - if [[ ${PV} == "9999" ]]; then - eautoreconf - else + # Run unconditionally (bug #792627) + eautoreconf + + if [[ ${PV} != "9999" ]]; then # Set module revision number sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" fi diff --git a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild index f57ff9699ac8..27cf80ed4300 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild @@ -27,7 +27,7 @@ else fi LICENSE="CDDL MIT debug? ( GPL-2+ )" -SLOT="0" +SLOT="0/${PVR}" IUSE="custom-cflags debug +rootfs" RDEPEND="${DEPEND} @@ -43,10 +43,25 @@ if [[ ${PV} != "9999" ]] ; then BDEPEND+=" verify-sig? ( app-crypt/openpgp-keys-openzfs )" fi +# PDEPEND in this form is needed to trick portage suggest +# enabling dist-kernel if only 1 package have it set +PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )" + RESTRICT="debug? ( strip ) test" DOCS=( AUTHORS COPYRIGHT META README.md ) +pkg_pretend() { + use rootfs || return 0 + + if has_version virtual/dist-kernel && ! use dist-kernel; then + ewarn "You have virtual/dist-kernel installed, but" + ewarn "USE=\"dist-kernel\" is not enabled for ${CATEGORY}/${PN}" + ewarn "It's recommended to globally enable dist-kernel USE flag" + ewarn "to auto-trigger initrd rebuilds with kernel updates" + fi +} + pkg_setup() { CONFIG_CHECK=" !DEBUG_LOCK_ALLOC @@ -91,9 +106,10 @@ pkg_setup() { src_prepare() { default - if [[ ${PV} == "9999" ]]; then - eautoreconf - else + # Run unconditionally (bug #792627) + eautoreconf + + if [[ ${PV} != "9999" ]]; then # Set module revision number sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release" fi |