zfs-2.3 commit
3cf2bfa57008af7f0690f73491d7f9b4ac4ed65a
Allocate zap_attribute_t from kmem instead of stack
za_name maximum size increased to ZAP_MAXNAMELEN_NEW
Ensure zap_attribute_t.za_name space is available and
zap_attribute_t.za_name_len now needs to be initialized
to the allocated space of MAXNAMELEN.
Also mkfs should disable longname support as it would break
MAX_NAME interop.
HPE-bug-id: LUS-12561
Test-Parameters: fstype=zfs
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I6c48c66a42a36ea6816b37ffce7e17f45eed3dbf
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56656
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Obsoletes: lustre-osd-mount < %{version}
%if 0%{confzfsdobjpath} != 0
%if 0%{?suse_version} >= 1500 || 0%{?rhel} >= 8 || 0%{?fedora} >= 34
-BuildRequires: (libzfs-devel or libzfs4-devel or libzfs5-devel)
+BuildRequires: (libzfs-devel or libzfs4-devel or libzfs5-devel or libzfs6-devel)
%else
# 'or' is not available, Use: --define 'zfs 5' or 'zfs 4'
BuildRequires: libzfs%{?zfs}-devel
struct osd_thread_info *info;
OBD_ALLOC_PTR(info);
- if (info != NULL)
- info->oti_env = container_of(ctx, struct lu_env, le_ctx);
- else
- info = ERR_PTR(-ENOMEM);
+ if (!info)
+ return ERR_PTR(-ENOMEM);
+
+ info->oti_env = container_of(ctx, struct lu_env, le_ctx);
+#ifdef ZAP_MAXNAMELEN_NEW
+ info->oti_za.za_name_len = MAXNAMELEN;
+ info->oti_za2.za_name_len = MAXNAMELEN;
+#endif
return info;
}
it->ozi_obj = obj;
it->ozi_reset = 1;
+#ifdef ZAP_MAXNAMELEN_NEW
+ it->ozi_za.za_name_len = MAXNAMELEN;
+#endif
lu_object_get(lo);
RETURN((struct dt_it *)it);
ENTRY;
/* temp. storage should be enough for any key supported by ZFS */
+#ifdef ZAP_MAXNAMELEN_NEW
+ LASSERT(za->za_name_len <= sizeof(it->ozi_name));
+#else
BUILD_BUG_ON(sizeof(za->za_name) > sizeof(it->ozi_name));
+#endif
/*
* the first ->next() moves the cursor to .
enum osd_zap_pos ozi_pos;
struct luz_direntry ozi_zde;
zap_attribute_t ozi_za;
+#ifdef ZAP_MAXNAMELEN_NEW
+ /* flexible array: zap_attribute_t.za_name[], ensure space allocated */
+ char ozi_za_name_buffer[MAXNAMELEN];
+#endif
union {
char ozi_name[MAXNAMELEN]; /* file name for dir */
__u64 ozi_key; /* binary key for index files */
struct lu_attr oti_la;
struct osa_attr oti_osa;
zap_attribute_t oti_za;
+#ifdef ZAP_MAXNAMELEN_NEW
+ /* flexible array: zap_attribute_t.za_name[], ensure space allocated */
+ char oti_za_name_buffer[MAXNAMELEN];
+#endif
zap_attribute_t oti_za2;
+#ifdef ZAP_MAXNAMELEN_NEW
+ /* flexible array: zap_attribute_t.za_name[], ensure space allocated */
+ char oti_za2_name_buffer[MAXNAMELEN];
+#endif
dmu_object_info_t oti_doi;
struct luz_direntry oti_zde;
return ret;
}
+/* interop will break if we change MAX_NAME from 255 */
+#ifdef ZAP_MAXNAMELEN_NEW
+#define ZFS_LONGNAME_FEATURE " -o feature@longname=disabled"
+#else
+#define ZFS_LONGNAME_FEATURE ""
+#endif
int zfs_make_lustre(struct mkfs_opts *mop)
{
memset(mkfs_cmd, 0, PATH_MAX);
snprintf(mkfs_cmd, PATH_MAX,
- "zpool create -f -O canmount=off %s", pool);
+ "zpool create%s -f -O canmount=off %s",
+ ZFS_LONGNAME_FEATURE, pool);
/* Append the vdev config and create file vdevs as required */
while (*mop->mo_pool_vdevs != NULL) {