mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
OpenZFS 8023 - Panic destroying a metaslab deferred range tree
Authored by: George Wilson <george.wilson@delphix.com> Approved by: Dan McDonald <danmcd@omniti.com> Reviewed by: Brad Lewis <brad.lewis@delphix.com> Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov> We don't want to dirty any data when we're in the final txgs of the pool export logic. This change introduces checks to make sure that no data is dirtied after a certain point. It also addresses the culprit of this specific bug – the space map cannot be upgraded when we're in final stages of pool export. If we encounter a space map that wants to be upgraded in this phase, then we simply ignore the request as it will get retried the next time we set the fragmentation metric on that metaslab. OpenZFS-issue: https://www.illumos.org/issues/8023 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/2ef00f5 Closes #5991
This commit is contained in:
committed by
Brian Behlendorf
parent
4c3c6b6c73
commit
3b7f360c96
@@ -23,7 +23,7 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012, 2016 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <sys/zfs_context.h>
|
||||
@@ -411,6 +411,7 @@ space_map_truncate(space_map_t *sm, dmu_tx_t *tx)
|
||||
|
||||
ASSERT(dsl_pool_sync_context(dmu_objset_pool(os)));
|
||||
ASSERT(dmu_tx_is_syncing(tx));
|
||||
VERIFY3U(dmu_tx_get_txg(tx), <=, spa_final_dirty_txg(spa));
|
||||
|
||||
dmu_object_info_from_db(sm->sm_dbuf, &doi);
|
||||
|
||||
@@ -425,9 +426,10 @@ space_map_truncate(space_map_t *sm, dmu_tx_t *tx)
|
||||
if ((spa_feature_is_enabled(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM) &&
|
||||
doi.doi_bonus_size != sizeof (space_map_phys_t)) ||
|
||||
doi.doi_data_block_size != space_map_blksz) {
|
||||
zfs_dbgmsg("txg %llu, spa %s, reallocating: "
|
||||
"old bonus %llu, old blocksz %u", dmu_tx_get_txg(tx),
|
||||
spa_name(spa), doi.doi_bonus_size, doi.doi_data_block_size);
|
||||
zfs_dbgmsg("txg %llu, spa %s, sm %p, reallocating "
|
||||
"object[%llu]: old bonus %u, old blocksz %u",
|
||||
dmu_tx_get_txg(tx), spa_name(spa), sm, sm->sm_object,
|
||||
doi.doi_bonus_size, doi.doi_data_block_size);
|
||||
|
||||
space_map_free(sm, tx);
|
||||
dmu_buf_rele(sm->sm_dbuf, sm);
|
||||
|
||||
Reference in New Issue
Block a user