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); ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH);
(void) nvlist_lookup_string(vdev, ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH, (void) nvlist_lookup_string(vdev, ZPOOL_CONFIG_VDEV_ENC_SYSFS_PATH,
&enc_sysfs_path); &enc_sysfs_path);
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK, &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_OFFLINE, &offline);
(void) nvlist_lookup_uint64(vdev, ZPOOL_CONFIG_FAULTED, &faulted); (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) if (!nvl)
return (0); return (0);
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk); (void) nvlist_lookup_uint64(nvl, ZPOOL_CONFIG_WHOLE_DISK, &wholedisk);
#endif
return (wholedisk); return (wholedisk);
} }
@ -1088,10 +1091,10 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data)
zpool_close(zhp); zpool_close(zhp);
return (0); return (0);
} }
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK, (void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
&wholedisk); &wholedisk);
#endif
if (wholedisk) { if (wholedisk) {
char *tmp; char *tmp;
path = strrchr(path, '/'); 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. * magic value left by the previous filesystem.
*/ */
verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path)); 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, verify(!nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
&wholedisk)); &wholedisk));
#endif
if (!wholedisk) { if (!wholedisk) {
/* /*
@ -1155,9 +1159,11 @@ is_device_in_use(nvlist_t *config, nvlist_t *nv, boolean_t force,
&child, &children) != 0) { &child, &children) != 0) {
verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path)); verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path));
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
if (strcmp(type, VDEV_TYPE_DISK) == 0) if (strcmp(type, VDEV_TYPE_DISK) == 0)
verify(!nvlist_lookup_uint64(nv, verify(!nvlist_lookup_uint64(nv,
ZPOOL_CONFIG_WHOLE_DISK, &wholedisk)); ZPOOL_CONFIG_WHOLE_DISK, &wholedisk));
#endif
/* /*
* As a generic check, we look to see if this is a replace of a * 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 += $(DEBUG_CPPFLAGS)
AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS) AM_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-@ac_system_l@-user\" 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 if ASAN_ENABLED
AM_CPPFLAGS += -DZFS_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) { nvlist_lookup_string(tgt, ZPOOL_CONFIG_PATH, &pathname) == 0) {
uint64_t wholedisk = 0; uint64_t wholedisk = 0;
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK, (void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
&wholedisk); &wholedisk);
#endif
/* /*
* XXX - L2ARC 1.0 devices can't support expansion. * 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)) { !(name_flags & VDEV_NAME_PATH)) {
path = zfs_strip_path(path); path = zfs_strip_path(path);
} }
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
/* /*
* Remove the partition from the path if this is a whole disk. * 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)) { == 0 && value && !(name_flags & VDEV_NAME_PATH)) {
return (zfs_strip_partition(path)); return (zfs_strip_partition(path));
} }
#endif
} else { } else {
path = type; path = type;

View File

@ -87,6 +87,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *path, const char *msg)
return (0); return (0);
} }
#ifndef TRUENAS_SCALE_NEVER_WHOLEDISK
/* /*
* Read the EFI label from the config, if a label does not exist then * 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 * 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); return (err);
} }
#endif
/* /*
* determine where a partition starts on a disk in the current * 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 static diskaddr_t
find_start_block(nvlist_t *config) find_start_block(nvlist_t *config)
{ {
#ifdef TRUENAS_SCALE_NEVER_WHOLEDISK
(void) config;
#else
nvlist_t **child; nvlist_t **child;
uint_t c, children; uint_t c, children;
diskaddr_t sb = MAXOFFSET_T; diskaddr_t sb = MAXOFFSET_T;
@ -149,6 +154,7 @@ find_start_block(nvlist_t *config)
return (sb); return (sb);
} }
} }
#endif
return (MAXOFFSET_T); return (MAXOFFSET_T);
} }

View File

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

View File

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

View File

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

View File

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