Skip to content

Commit

Permalink
7743 per-vdev-zaps have no initialize path on upgrade
Browse files Browse the repository at this point in the history
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Approved by: Robert Mustacchi <rm@joyent.com>
  • Loading branch information
pcd1193182 authored and ahrens committed Jan 12, 2017
1 parent 0e93ddd commit 555da51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions usr/src/uts/common/fs/zfs/spa.c
Expand Up @@ -2657,10 +2657,14 @@ spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
error = spa_dir_prop(spa, DMU_POOL_VDEV_ZAP_MAP,
&spa->spa_all_vdev_zaps);

if (error != ENOENT && error != 0) {
if (error == ENOENT) {
VERIFY(!nvlist_exists(mos_config,
ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS));
spa->spa_avz_action = AVZ_ACTION_INITIALIZE;
ASSERT0(vdev_count_verify_zaps(spa->spa_root_vdev));
} else if (error != 0) {
return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO));
} else if (error == 0 && !nvlist_exists(mos_config,
ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)) {
} else if (!nvlist_exists(mos_config, ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)) {
/*
* An older version of ZFS overwrote the sentinel value, so
* we have orphaned per-vdev ZAPs in the MOS. Defer their
Expand Down Expand Up @@ -6156,6 +6160,7 @@ spa_sync_config_object(spa_t *spa, dmu_tx_t *tx)
spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);

ASSERT(spa->spa_avz_action == AVZ_ACTION_NONE ||
spa->spa_avz_action == AVZ_ACTION_INITIALIZE ||
spa->spa_all_vdev_zaps != 0);

if (spa->spa_avz_action == AVZ_ACTION_REBUILD) {
Expand Down
3 changes: 2 additions & 1 deletion usr/src/uts/common/fs/zfs/sys/spa_impl.h
Expand Up @@ -119,7 +119,8 @@ typedef struct spa_taskqs {
typedef enum spa_all_vdev_zap_action {
AVZ_ACTION_NONE = 0,
AVZ_ACTION_DESTROY, /* Destroy all per-vdev ZAPs and the AVZ. */
AVZ_ACTION_REBUILD /* Populate the new AVZ, see spa_avz_rebuild */
AVZ_ACTION_REBUILD, /* Populate the new AVZ, see spa_avz_rebuild */
AVZ_ACTION_INITIALIZE
} spa_avz_action_t;

struct spa {
Expand Down

0 comments on commit 555da51

Please sign in to comment.