diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c index 69163b80bd..4bc9f044e4 100644 --- a/cmd/zed/agents/zfs_mod.c +++ b/cmd/zed/agents/zfs_mod.c @@ -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, '/'); diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index fbd4b81dfa..0ba326473e 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -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 diff --git a/config/Rules.am b/config/Rules.am index 01d3ff086c..6997f4e3bf 100644 --- a/config/Rules.am +++ b/config/Rules.am @@ -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 diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 402c14a6ba..7201353015 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -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; diff --git a/lib/libzfs/os/linux/libzfs_pool_os.c b/lib/libzfs/os/linux/libzfs_pool_os.c index 86eef3255b..088ba4ea23 100644 --- a/lib/libzfs/os/linux/libzfs_pool_os.c +++ b/lib/libzfs/os/linux/libzfs_pool_os.c @@ -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); } diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh index 5e8f1d7053..7eadb03793 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_expand/zpool_expand_005_pos.ksh @@ -45,6 +45,8 @@ verify_runnable "global" +log_unsupported "SKIP because auto partitioning removed for SCALE" + function cleanup { poolexists $TESTPOOL1 && destroy_pool $TESTPOOL1 diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_reopen/zpool_reopen_005_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_reopen/zpool_reopen_005_pos.ksh index 095f3bc05e..bccfaa27e3 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_reopen/zpool_reopen_005_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_reopen/zpool_reopen_005_pos.ksh @@ -38,6 +38,8 @@ verify_runnable "global" +log_unsupported "SKIP because auto partitioning removed for SCALE" + function cleanup { log_must zinject -c all diff --git a/tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh index c0387e1d32..d1bf2e8641 100755 --- a/tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/fault/auto_offline_001_pos.ksh @@ -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 diff --git a/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh b/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh index ae56ee9919..b6b9f789ed 100755 --- a/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/fault/auto_replace_001_pos.ksh @@ -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