SCALE: ignore wholedisk

We never want to partition vdevs automatically from ZFS in SCALE.

Ignore the wholedisk flag in SCALE and skip the tests that expect
auto partitioning to work.

Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
This commit is contained in:
Ryan Moeller 2022-11-03 15:21:28 +00:00 committed by Ameer Hamza
parent 5b009301f4
commit 2df4032585
9 changed files with 35 additions and 4 deletions

View File

@ -238,8 +238,9 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled)
ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH);
(void) nvlist_lookup_string(vdev, ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH,
&enc_sysfs_path);
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk);
#endif
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_OFFLINE, &offline);
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_FAULTED, &faulted);
@ -1040,7 +1041,9 @@ vdev_whole_disk_from_config(zpool_handle_t *zhp, const char *vdev_path)
if (!nvl)
return (0);
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk);
#endif
return (wholedisk);
}
@ -1088,10 +1091,10 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data)
zpool_close(zhp);
return (0);
}
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
&wholedisk);
#endif
if (wholedisk) {
char *tmp;
path = strrchr(path, '/');

View File

@ -989,8 +989,12 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv, boolean_t replacing)
* magic value left by the previous filesystem.
*/
verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path));
#ifdef TRUENAS_SCALE_NEVER_WHOLEDISK
wholedisk = B_FALSE;
#else
verify(!nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
&wholedisk));
#endif
if (!wholedisk) {
/*
@ -1155,9 +1159,11 @@ is_device_in_use(nvlist_t *config, nvlist_t *nv, boolean_t force,
&child, &children) != 0) {
verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path));
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
if (strcmp(type, VDEV_TYPE_DISK) == 0)
verify(!nvlist_lookup_uint64(nv,
ZPOOL_CONFIG_WHOLE_DISK, &wholedisk));
#endif
/*
* As a generic check, we look to see if this is a replace of a

View File

@ -52,6 +52,12 @@ AM_CPPFLAGS += -DPKGDATADIR=\"$(pkgdatadir)\"
AM_CPPFLAGS += $(DEBUG_CPPFLAGS)
AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-@ac_system_l@-user\"
if BUILD_LINUX
# NAS-118236: Vdevs from CORE are labeled with whole_disk=1, but we did not
# create the partition table in ZFS and must not repartition them. We know
# SCALE never creates wholedisk vdevs, so just ignore the config.
AM_CPPFLAGS += -DTRUENAS_SCALE_NEVER_WHOLEDISK
endif
if ASAN_ENABLED
AM_CPPFLAGS += -DZFS_ASAN_ENABLED

View File

@ -3158,8 +3158,10 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH, &pathname) == 0) {
uint64_t wholedisk = 0;
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
&wholedisk);
#endif
/*
* XXX - L2ARC 1.0 devices can't support expansion.
@ -4314,7 +4316,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
!(name_flags & VDEV_NAME_PATH)) {
path = zfs_strip_path(path);
}
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
/*
* Remove the partition from the path if this is a whole disk.
*/
@ -4323,6 +4325,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
== 0 && value && !(name_flags & VDEV_NAME_PATH)) {
return (zfs_strip_partition(path));
}
#endif
} else {
path = type;

View File

@ -87,6 +87,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *path, const char *msg)
return (0);
}
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
/*
* Read the EFI label from the config, if a label does not exist then
* pass back the error to the caller. If the caller has passed a non-NULL
@ -118,6 +119,7 @@ read_efi_label(nvlist_t *config, diskaddr_t *sb)
}
return (err);
}
#endif
/*
* determine where a partition starts on a disk in the current
@ -126,6 +128,9 @@ read_efi_label(nvlist_t *config, diskaddr_t *sb)
static diskaddr_t
find_start_block(nvlist_t *config)
{
#ifdef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) config;
#else
nvlist_t **child;
uint_t c, children;
diskaddr_t sb = MAXOFFSET_T;
@ -149,6 +154,7 @@ find_start_block(nvlist_t *config)
return (sb);
}
}
#endif
return (MAXOFFSET_T);
}

View File

@ -45,6 +45,8 @@
verify_runnable "global"
log_unsupported "SKIP because auto partitioning removed for SCALE"
function cleanup
{
poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1

View File

@ -38,6 +38,8 @@
verify_runnable "global"
log_unsupported "SKIP because auto partitioning removed for SCALE"
function cleanup
{
log_must zinject -c all

View File

@ -50,6 +50,7 @@
verify_runnable "both"
if is_linux; then
log_unsupported "SKIP because auto partitioning removed for SCALE"
# Add one 512b scsi_debug device (4Kn would generate IO errors)
# NOTE: must be larger than other "file" vdevs and minimum SPA devsize:
# add 32m of fudge

View File

@ -49,6 +49,8 @@
verify_runnable "both"
log_unsupported "SKIP because auto partitioning removed for SCALE"
if ! is_physical_device $DISKS; then
log_unsupported "Unsupported disks for this test."
fi