Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
- debian/control.in | 36 +++---------------
+ debian/control.in | 37 +++---------------
debian/control | 1 -
debian/not-installed | 1 +
debian/rules | 105 +--------------------------------------------------
- 4 files changed, 8 insertions(+), 135 deletions(-)
+ 4 files changed, 8 insertions(+), 136 deletions(-)
diff --git a/debian/control.in b/debian/control.in
-index 771fc3a80..edfed470f 100644
+index b3ef99870..8e69b6e37 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -8,7 +8,6 @@ Uploaders: Aron Xu <aron@debian.org>,
-Architecture: all
-Pre-Depends: spl-dkms (>= ${source:Upstream-Version}), spl-dkms (<<${source:Upstream-Version}.)
-Depends: dkms (>> 2.1.1.2-5), lsb-release, ${misc:Depends}
--Recommends: zfsutils-linux, zfs-zed
+-Recommends: zfsutils-linux (>= ${binary:Version}), zfs-zed
-Provides: zfs-modules
-Description: OpenZFS filesystem kernel modules for Linux
- The Z file system is a pooled filesystem designed for maximum data
Architecture: all
Depends: initramfs-tools,
busybox-initramfs | busybox-static | busybox,
-- zfs-modules | zfs-dkms, zfsutils-linux,
-+ zfsutils-linux,
+- zfs-modules | zfs-dkms, zfsutils-linux (>= ${binary:Version}),
++ zfsutils-linux (>= ${binary:Version}),
${misc:Depends}
Description: OpenZFS root filesystem capabilities for Linux - initramfs
The Z file system is a pooled filesystem designed for maximum data
-@@ -112,23 +97,12 @@ Description: OpenZFS root filesystem capabilities for Linux - initramfs
+@@ -112,24 +97,12 @@ Description: OpenZFS root filesystem capabilities for Linux - initramfs
This package adds OpenZFS to the system initramfs with a hook
for the initramfs-tools infrastructure.
-Package: zfs-dracut
-Architecture: all
--Depends: dracut, zfs-modules | zfs-dkms, zfsutils-linux, ${misc:Depends}
+-Depends: dracut, zfs-modules | zfs-dkms, zfsutils-linux (>= ${binary:Version}), ${misc:Depends}
-Description: OpenZFS root filesystem capabilities for Linux - dracut
- The Z file system is a pooled filesystem designed for maximum data
- integrity, supporting data snapshots, multiple copies, and data
Architecture: linux-any
Depends: ${misc:Depends}, ${shlibs:Depends}, ${python3:Depends}, python3
-Recommends: lsb-base, zfs-modules | zfs-dkms, zfs-zed
+-Breaks: zfs-dkms (>> ${binary:Version}), zfs-dkms (<< ${binary:Version})
-Suggests: nfs-kernel-server, samba-common-bin (>= 3.0.23), zfs-initramfs | zfs-dracut
+Recommends: lsb-base, zfs-zed
+Suggests: nfs-kernel-server, samba-common-bin (>= 3.0.23), zfs-initramfs
Conflicts: zfs, zfs-fuse, zutils
Provides: zfsutils
Description: command-line tools to manage OpenZFS filesystems
-@@ -142,7 +116,7 @@ Description: command-line tools to manage OpenZFS filesystems
+@@ -143,7 +116,7 @@ Description: command-line tools to manage OpenZFS filesystems
Package: zfs-zed
Section: contrib/admin
Architecture: linux-any
--Depends: ${misc:Depends}, ${shlibs:Depends}, zfs-modules | zfs-dkms, zfsutils-linux
-+Depends: ${misc:Depends}, ${shlibs:Depends}, zfsutils-linux
+-Depends: ${misc:Depends}, ${shlibs:Depends}, zfs-modules | zfs-dkms, zfsutils-linux (>= ${binary:Version})
++Depends: ${misc:Depends}, ${shlibs:Depends}, zfsutils-linux (>= ${binary:Version})
Description: OpenZFS Event Daemon
The Z file system is a pooled filesystem designed for maximum data
integrity, supporting data snapshots, multiple copies, and data
-@@ -153,7 +127,7 @@ Description: OpenZFS Event Daemon
+@@ -154,7 +127,7 @@ Description: OpenZFS Event Daemon
Package: zfs-test
Section: contrib/admin
Architecture: linux-any
--Depends: ${misc:Depends}, ${shlibs:Depends}, zfs-modules | zfs-dkms, zfsutils-linux, parted, lsscsi, mdadm, bc, ksh, fio, acl, sudo, sysstat, python
-+Depends: ${misc:Depends}, ${shlibs:Depends}, zfsutils-linux, parted, lsscsi, mdadm, bc, ksh, fio, acl, sudo, sysstat, python
+-Depends: ${misc:Depends}, ${shlibs:Depends}, zfs-modules | zfs-dkms, zfsutils-linux (>=${binary:Version}), parted, lsscsi, mdadm, bc, ksh, fio, acl, sudo, sysstat, python
++Depends: ${misc:Depends}, ${shlibs:Depends}, zfsutils-linux (>=${binary:Version}), parted, lsscsi, mdadm, bc, ksh, fio, acl, sudo, sysstat, python
Breaks: zfsutils-linux (<= 0.6.5.11-1)
Replaces: zfsutils-linux (<= 0.6.5.11-1)
Description: OpenZFS test infrastructure an support scripts
diff --git a/debian/control b/debian/control
-index 771fc3a80..be0b90337 100644
+index b3ef99870..816403e44 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,6 @@ Uploaders: Aron Xu <aron@debian.org>,
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Antonio Russo <antonio.e.russo@gmail.com>
-Date: Mon, 18 Dec 2017 12:43:55 -0500
-Subject: [PATCH] Enable zfs-import.target in systemd preset (#6968)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Cherry picked line from PR #6822, this enables the new
-target introduced in PR #6764.
-
-Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
-(cherry picked from commit da16fc5739b1962b3d357246938d2df06d6a1075)
-Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
----
- etc/systemd/system/50-zfs.preset.in | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/etc/systemd/system/50-zfs.preset.in b/etc/systemd/system/50-zfs.preset.in
-index 4d82778e3..884a69b5b 100644
---- a/etc/systemd/system/50-zfs.preset.in
-+++ b/etc/systemd/system/50-zfs.preset.in
-@@ -1,6 +1,7 @@
- # ZFS is enabled by default
- enable zfs-import-cache.service
- disable zfs-import-scan.service
-+enable zfs-import.target
- enable zfs-mount.service
- enable zfs-share.service
- enable zfs-zed.service
---
-2.14.2
-
--- /dev/null
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Mon, 8 Jan 2018 09:52:36 -0800
+Subject: [PATCH] Fix ARC hit rate
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When the compressed ARC feature was added in commit d3c2ae1
+the method of reference counting in the ARC was modified. As
+part of this accounting change the arc_buf_add_ref() function
+was removed entirely.
+
+This would have be fine but the arc_buf_add_ref() function
+served a second undocumented purpose of updating the ARC access
+information when taking a hold on a dbuf. Without this logic
+in place a cached dbuf would not migrate its associated
+arc_buf_hdr_t to the MFU list. This would negatively impact
+the ARC hit rate, particularly on systems with a small ARC.
+
+This change reinstates the missing call to arc_access() from
+dbuf_hold() by implementing a new arc_buf_access() function.
+
+Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
+Reviewed-by: Tony Hutter <hutter2@llnl.gov>
+Reviewed-by: Tim Chase <tim@chase2k.com>
+Reviewed by: George Wilson <george.wilson@delphix.com>
+Reviewed-by: George Melikov <mail@gmelikov.ru>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #6171
+Closes #6852
+Closes #6989
+Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
+---
+ include/sys/arc.h | 1 +
+ module/zfs/arc.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ module/zfs/dbuf.c | 4 +++-
+ 3 files changed, 56 insertions(+), 3 deletions(-)
+
+diff --git a/include/sys/arc.h b/include/sys/arc.h
+index 66f37cf71..1ea4937bd 100644
+--- a/include/sys/arc.h
++++ b/include/sys/arc.h
+@@ -221,6 +221,7 @@ void arc_buf_destroy(arc_buf_t *buf, void *tag);
+ void arc_buf_info(arc_buf_t *buf, arc_buf_info_t *abi, int state_index);
+ uint64_t arc_buf_size(arc_buf_t *buf);
+ uint64_t arc_buf_lsize(arc_buf_t *buf);
++void arc_buf_access(arc_buf_t *buf);
+ void arc_release(arc_buf_t *buf, void *tag);
+ int arc_released(arc_buf_t *buf);
+ void arc_buf_sigsegv(int sig, siginfo_t *si, void *unused);
+diff --git a/module/zfs/arc.c b/module/zfs/arc.c
+index 2b0a78d4b..264e67735 100644
+--- a/module/zfs/arc.c
++++ b/module/zfs/arc.c
+@@ -429,9 +429,14 @@ typedef struct arc_stats {
+ * by multiple buffers.
+ */
+ kstat_named_t arcstat_mutex_miss;
++ /*
++ * Number of buffers skipped when updating the access state due to the
++ * header having already been released after acquiring the hash lock.
++ */
++ kstat_named_t arcstat_access_skip;
+ /*
+ * Number of buffers skipped because they have I/O in progress, are
+- * indrect prefetch buffers that have not lived long enough, or are
++ * indirect prefetch buffers that have not lived long enough, or are
+ * not from the spa we're trying to evict from.
+ */
+ kstat_named_t arcstat_evict_skip;
+@@ -667,6 +672,7 @@ static arc_stats_t arc_stats = {
+ { "mfu_ghost_hits", KSTAT_DATA_UINT64 },
+ { "deleted", KSTAT_DATA_UINT64 },
+ { "mutex_miss", KSTAT_DATA_UINT64 },
++ { "access_skip", KSTAT_DATA_UINT64 },
+ { "evict_skip", KSTAT_DATA_UINT64 },
+ { "evict_not_enough", KSTAT_DATA_UINT64 },
+ { "evict_l2_cached", KSTAT_DATA_UINT64 },
+@@ -4926,7 +4932,51 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock)
+ }
+ }
+
+-/* a generic arc_done_func_t which you can use */
++/*
++ * This routine is called by dbuf_hold() to update the arc_access() state
++ * which otherwise would be skipped for entries in the dbuf cache.
++ */
++void
++arc_buf_access(arc_buf_t *buf)
++{
++ mutex_enter(&buf->b_evict_lock);
++ arc_buf_hdr_t *hdr = buf->b_hdr;
++
++ /*
++ * Avoid taking the hash_lock when possible as an optimization.
++ * The header must be checked again under the hash_lock in order
++ * to handle the case where it is concurrently being released.
++ */
++ if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) {
++ mutex_exit(&buf->b_evict_lock);
++ return;
++ }
++
++ kmutex_t *hash_lock = HDR_LOCK(hdr);
++ mutex_enter(hash_lock);
++
++ if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) {
++ mutex_exit(hash_lock);
++ mutex_exit(&buf->b_evict_lock);
++ ARCSTAT_BUMP(arcstat_access_skip);
++ return;
++ }
++
++ mutex_exit(&buf->b_evict_lock);
++
++ ASSERT(hdr->b_l1hdr.b_state == arc_mru ||
++ hdr->b_l1hdr.b_state == arc_mfu);
++
++ DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr);
++ arc_access(hdr, hash_lock);
++ mutex_exit(hash_lock);
++
++ ARCSTAT_BUMP(arcstat_hits);
++ ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr), demand, prefetch,
++ !HDR_ISTYPE_METADATA(hdr), data, metadata, hits);
++}
++
++/* a generic arc_read_done_func_t which you can use */
+ /* ARGSUSED */
+ void
+ arc_bcopy_func(zio_t *zio, arc_buf_t *buf, void *arg)
+diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
+index 60f52d294..4ee121f5a 100644
+--- a/module/zfs/dbuf.c
++++ b/module/zfs/dbuf.c
+@@ -2719,8 +2719,10 @@ __dbuf_hold_impl(struct dbuf_hold_impl_data *dh)
+ return (SET_ERROR(ENOENT));
+ }
+
+- if (dh->dh_db->db_buf != NULL)
++ if (dh->dh_db->db_buf != NULL) {
++ arc_buf_access(dh->dh_db->db_buf);
+ ASSERT3P(dh->dh_db->db.db_data, ==, dh->dh_db->db_buf->b_data);
++ }
+
+ ASSERT(dh->dh_db->db_buf == NULL || arc_referenced(dh->dh_db->db_buf));
+
+--
+2.14.2
+
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Brian Behlendorf <behlendorf1@llnl.gov>
-Date: Mon, 8 Jan 2018 09:52:36 -0800
-Subject: [PATCH] Fix ARC hit rate
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When the compressed ARC feature was added in commit d3c2ae1
-the method of reference counting in the ARC was modified. As
-part of this accounting change the arc_buf_add_ref() function
-was removed entirely.
-
-This would have be fine but the arc_buf_add_ref() function
-served a second undocumented purpose of updating the ARC access
-information when taking a hold on a dbuf. Without this logic
-in place a cached dbuf would not migrate its associated
-arc_buf_hdr_t to the MFU list. This would negatively impact
-the ARC hit rate, particularly on systems with a small ARC.
-
-This change reinstates the missing call to arc_access() from
-dbuf_hold() by implementing a new arc_buf_access() function.
-
-Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
-Reviewed-by: Tony Hutter <hutter2@llnl.gov>
-Reviewed-by: Tim Chase <tim@chase2k.com>
-Reviewed by: George Wilson <george.wilson@delphix.com>
-Reviewed-by: George Melikov <mail@gmelikov.ru>
-Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Closes #6171
-Closes #6852
-Closes #6989
-Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
----
- include/sys/arc.h | 1 +
- module/zfs/arc.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
- module/zfs/dbuf.c | 4 +++-
- 3 files changed, 56 insertions(+), 3 deletions(-)
-
-diff --git a/include/sys/arc.h b/include/sys/arc.h
-index 66f37cf71..1ea4937bd 100644
---- a/include/sys/arc.h
-+++ b/include/sys/arc.h
-@@ -221,6 +221,7 @@ void arc_buf_destroy(arc_buf_t *buf, void *tag);
- void arc_buf_info(arc_buf_t *buf, arc_buf_info_t *abi, int state_index);
- uint64_t arc_buf_size(arc_buf_t *buf);
- uint64_t arc_buf_lsize(arc_buf_t *buf);
-+void arc_buf_access(arc_buf_t *buf);
- void arc_release(arc_buf_t *buf, void *tag);
- int arc_released(arc_buf_t *buf);
- void arc_buf_sigsegv(int sig, siginfo_t *si, void *unused);
-diff --git a/module/zfs/arc.c b/module/zfs/arc.c
-index 2b0a78d4b..264e67735 100644
---- a/module/zfs/arc.c
-+++ b/module/zfs/arc.c
-@@ -429,9 +429,14 @@ typedef struct arc_stats {
- * by multiple buffers.
- */
- kstat_named_t arcstat_mutex_miss;
-+ /*
-+ * Number of buffers skipped when updating the access state due to the
-+ * header having already been released after acquiring the hash lock.
-+ */
-+ kstat_named_t arcstat_access_skip;
- /*
- * Number of buffers skipped because they have I/O in progress, are
-- * indrect prefetch buffers that have not lived long enough, or are
-+ * indirect prefetch buffers that have not lived long enough, or are
- * not from the spa we're trying to evict from.
- */
- kstat_named_t arcstat_evict_skip;
-@@ -667,6 +672,7 @@ static arc_stats_t arc_stats = {
- { "mfu_ghost_hits", KSTAT_DATA_UINT64 },
- { "deleted", KSTAT_DATA_UINT64 },
- { "mutex_miss", KSTAT_DATA_UINT64 },
-+ { "access_skip", KSTAT_DATA_UINT64 },
- { "evict_skip", KSTAT_DATA_UINT64 },
- { "evict_not_enough", KSTAT_DATA_UINT64 },
- { "evict_l2_cached", KSTAT_DATA_UINT64 },
-@@ -4926,7 +4932,51 @@ arc_access(arc_buf_hdr_t *hdr, kmutex_t *hash_lock)
- }
- }
-
--/* a generic arc_done_func_t which you can use */
-+/*
-+ * This routine is called by dbuf_hold() to update the arc_access() state
-+ * which otherwise would be skipped for entries in the dbuf cache.
-+ */
-+void
-+arc_buf_access(arc_buf_t *buf)
-+{
-+ mutex_enter(&buf->b_evict_lock);
-+ arc_buf_hdr_t *hdr = buf->b_hdr;
-+
-+ /*
-+ * Avoid taking the hash_lock when possible as an optimization.
-+ * The header must be checked again under the hash_lock in order
-+ * to handle the case where it is concurrently being released.
-+ */
-+ if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) {
-+ mutex_exit(&buf->b_evict_lock);
-+ return;
-+ }
-+
-+ kmutex_t *hash_lock = HDR_LOCK(hdr);
-+ mutex_enter(hash_lock);
-+
-+ if (hdr->b_l1hdr.b_state == arc_anon || HDR_EMPTY(hdr)) {
-+ mutex_exit(hash_lock);
-+ mutex_exit(&buf->b_evict_lock);
-+ ARCSTAT_BUMP(arcstat_access_skip);
-+ return;
-+ }
-+
-+ mutex_exit(&buf->b_evict_lock);
-+
-+ ASSERT(hdr->b_l1hdr.b_state == arc_mru ||
-+ hdr->b_l1hdr.b_state == arc_mfu);
-+
-+ DTRACE_PROBE1(arc__hit, arc_buf_hdr_t *, hdr);
-+ arc_access(hdr, hash_lock);
-+ mutex_exit(hash_lock);
-+
-+ ARCSTAT_BUMP(arcstat_hits);
-+ ARCSTAT_CONDSTAT(!HDR_PREFETCH(hdr), demand, prefetch,
-+ !HDR_ISTYPE_METADATA(hdr), data, metadata, hits);
-+}
-+
-+/* a generic arc_read_done_func_t which you can use */
- /* ARGSUSED */
- void
- arc_bcopy_func(zio_t *zio, arc_buf_t *buf, void *arg)
-diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
-index 60f52d294..4ee121f5a 100644
---- a/module/zfs/dbuf.c
-+++ b/module/zfs/dbuf.c
-@@ -2719,8 +2719,10 @@ __dbuf_hold_impl(struct dbuf_hold_impl_data *dh)
- return (SET_ERROR(ENOENT));
- }
-
-- if (dh->dh_db->db_buf != NULL)
-+ if (dh->dh_db->db_buf != NULL) {
-+ arc_buf_access(dh->dh_db->db_buf);
- ASSERT3P(dh->dh_db->db.db_data, ==, dh->dh_db->db_buf->b_data);
-+ }
-
- ASSERT(dh->dh_db->db_buf == NULL || arc_referenced(dh->dh_db->db_buf));
-
---
-2.14.2
-
--- /dev/null
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= <f.gruenbichler@proxmox.com>
+Date: Fri, 19 Jan 2018 12:13:46 +0100
+Subject: [PATCH] always load ZFS module on boot
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+since zfs-import-scan.service is disabled by default, and
+zfs-import-cache.service only gets started if a cache file exists, this
+is needed for zfs-mount, zfs-share and zfs-zed services in case ZFS is
+not actually used.
+
+Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
+---
+ etc/modules-load.d/zfs.conf.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/etc/modules-load.d/zfs.conf.in b/etc/modules-load.d/zfs.conf.in
+index 8b41baa30..59b058c9a 100644
+--- a/etc/modules-load.d/zfs.conf.in
++++ b/etc/modules-load.d/zfs.conf.in
+@@ -1,3 +1,3 @@
+ # Always load kernel modules at boot. The default behavior is to load the
+ # kernel modules in the zfs-import-*.service or when blkid(8) detects a pool.
+-#zfs
++zfs
+--
+2.14.2
+
+++ /dev/null
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= <f.gruenbichler@proxmox.com>
-Date: Fri, 19 Jan 2018 12:13:46 +0100
-Subject: [PATCH] always load ZFS module on boot
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-since zfs-import-scan.service is disabled by default, and
-zfs-import-cache.service only gets started if a cache file exists, this
-is needed for zfs-mount, zfs-share and zfs-zed services in case ZFS is
-not actually used.
-
-Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
----
- etc/modules-load.d/zfs.conf.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/etc/modules-load.d/zfs.conf.in b/etc/modules-load.d/zfs.conf.in
-index 8b41baa30..59b058c9a 100644
---- a/etc/modules-load.d/zfs.conf.in
-+++ b/etc/modules-load.d/zfs.conf.in
-@@ -1,3 +1,3 @@
- # Always load kernel modules at boot. The default behavior is to load the
- # kernel modules in the zfs-import-*.service or when blkid(8) detects a pool.
--#zfs
-+zfs
---
-2.14.2
-
0001-remove-DKMS-modules-and-dracut-build.patch
0002-import-with-d-dev-disk-by-id-in-scan-service.patch
0003-Use-user-namespaces-for-FSETID-policy-check.patch
-0004-Enable-zfs-import.target-in-systemd-preset-6968.patch
-0005-Fix-ARC-hit-rate.patch
-0006-always-load-ZFS-module-on-boot.patch
+0004-Fix-ARC-hit-rate.patch
+0005-always-load-ZFS-module-on-boot.patch