Deleted Added
sdiff udiff text old ( 321529 ) new ( 321540 )
full compact
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 2722 unchanged lines hidden (view full) ---

2731 /* The sentinel is only available in the MOS config. */
2732 nvlist_t *mos_config;
2733 if (load_nvlist(spa, spa->spa_config_object, &mos_config) != 0)
2734 return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO));
2735
2736 error = spa_dir_prop(spa, DMU_POOL_VDEV_ZAP_MAP,
2737 &spa->spa_all_vdev_zaps);
2738
2739 if (error != ENOENT && error != 0) {
2740 return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO));
2741 } else if (error == 0 && !nvlist_exists(mos_config,
2742 ZPOOL_CONFIG_HAS_PER_VDEV_ZAPS)) {
2743 /*
2744 * An older version of ZFS overwrote the sentinel value, so
2745 * we have orphaned per-vdev ZAPs in the MOS. Defer their
2746 * destruction to later; see spa_sync_config_object.
2747 */
2748 spa->spa_avz_action = AVZ_ACTION_DESTROY;
2749 /*
2750 * We're assuming that no vdevs have had their ZAPs created

--- 3747 unchanged lines hidden (view full) ---

6498 */
6499 if (list_is_empty(&spa->spa_config_dirty_list) &&
6500 spa->spa_avz_action == AVZ_ACTION_NONE)
6501 return;
6502
6503 spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
6504
6505 ASSERT(spa->spa_avz_action == AVZ_ACTION_NONE ||
6506 spa->spa_all_vdev_zaps != 0);
6507
6508 if (spa->spa_avz_action == AVZ_ACTION_REBUILD) {
6509 /* Make and build the new AVZ */
6510 uint64_t new_avz = zap_create(spa->spa_meta_objset,
6511 DMU_OTN_ZAP_METADATA, DMU_OT_NONE, 0, tx);
6512 spa_avz_build(spa->spa_root_vdev, new_avz, tx);
6513

--- 865 unchanged lines hidden ---