[PATCH][BIONIC] UBUNTU: SAUCE: Fix ioctl loop-spin in zed (LP: #1751796)
Colin King
colin.king at canonical.com
Mon Mar 26 10:58:14 UTC 2018
From: Colin Ian King <colin.king at canonical.com>
Add ZFS 0.6.x kernel ioctl binary compat shim, detect ZFS kernel driver
version and copy zfs ioctl command to the newer ZFS 0.7.0 ioctl command layout.
This allows zed to be upgraded from a pre-0.7.0 ZFS to 0.7.0 without causing
ioctl breakage.
This patch sync's the kernel drivers to the module fixes in userspace, introduced
in version zfsutils-linux 0.7.5-1ubuntu8. No functional change in the kernel drivers;
this just adds compat structures to allow userspace to copy ioctl data appropriately
in the userspace tools.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
zfs/META | 2 +-
zfs/include/sys/zfs_ioctl.h | 61 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 62 insertions(+), 1 deletion(-)
diff --git a/zfs/META b/zfs/META
index e3a052f..3af1334 100644
--- a/zfs/META
+++ b/zfs/META
@@ -2,7 +2,7 @@ Meta: 1
Name: zfs
Branch: 1.0
Version: 0.7.5
-Release: 1ubuntu6
+Release: 1ubuntu8
Release-Tags: relext
License: CDDL
Author: OpenZFS on Linux
diff --git a/zfs/include/sys/zfs_ioctl.h b/zfs/include/sys/zfs_ioctl.h
index c68b877..568b45b 100644
--- a/zfs/include/sys/zfs_ioctl.h
+++ b/zfs/include/sys/zfs_ioctl.h
@@ -328,6 +328,25 @@ typedef struct zinject_record {
uint32_t zi_pad;
} zinject_record_t;
+typedef struct zinject_record_V065 {
+ uint64_t zi_objset;
+ uint64_t zi_object;
+ uint64_t zi_start;
+ uint64_t zi_end;
+ uint64_t zi_guid;
+ uint32_t zi_level;
+ uint32_t zi_error;
+ uint64_t zi_type;
+ uint32_t zi_freq;
+ uint32_t zi_failfast;
+ char zi_func[MAXNAMELEN];
+ uint32_t zi_iotype;
+ int32_t zi_duration;
+ uint64_t zi_timer;
+ uint32_t zi_cmd;
+ uint32_t zi_pad;
+} zinject_record_V065_t;
+
#define ZINJECT_NULL 0x1
#define ZINJECT_FLUSH_ARC 0x2
#define ZINJECT_UNLOAD_SPA 0x4
@@ -420,6 +439,48 @@ typedef struct zfs_cmd {
zfs_stat_t zc_stat;
} zfs_cmd_t;
+typedef struct zfs_cmd_V065 {
+ char zc_name[MAXPATHLEN]; /* name of pool or dataset */
+ uint64_t zc_nvlist_src; /* really (char *) */
+ uint64_t zc_nvlist_src_size;
+ uint64_t zc_nvlist_dst; /* really (char *) */
+ uint64_t zc_nvlist_dst_size;
+ boolean_t zc_nvlist_dst_filled; /* put an nvlist in dst? */
+ int zc_pad2;
+
+ /*
+ * The following members are for legacy ioctls which haven't been
+ * converted to the new method.
+ */
+ uint64_t zc_history; /* really (char *) */
+ char zc_value[MAXPATHLEN * 2];
+ char zc_string[MAXNAMELEN];
+ uint64_t zc_guid;
+ uint64_t zc_nvlist_conf; /* really (char *) */
+ uint64_t zc_nvlist_conf_size;
+ uint64_t zc_cookie;
+ uint64_t zc_objset_type;
+ uint64_t zc_perm_action;
+ uint64_t zc_history_len;
+ uint64_t zc_history_offset;
+ uint64_t zc_obj;
+ uint64_t zc_iflags; /* internal to zfs(7fs) */
+ zfs_share_t zc_share;
+ dmu_objset_stats_t zc_objset_stats;
+ struct drr_begin zc_begin_record;
+ zinject_record_V065_t zc_inject_record;
+ uint32_t zc_defer_destroy;
+ uint32_t zc_flags;
+ uint64_t zc_action_handle;
+ int zc_cleanup_fd;
+ uint8_t zc_simple;
+ uint8_t zc_pad[3]; /* alignment */
+ uint64_t zc_sendobj;
+ uint64_t zc_fromobj;
+ uint64_t zc_createtxg;
+ zfs_stat_t zc_stat;
+} zfs_cmd_V065_t;
+
typedef struct zfs_useracct {
char zu_domain[256];
uid_t zu_rid;
--
2.7.4
More information about the kernel-team
mailing list