Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions module/zfs/vdev_rebuild.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* Copyright (c) 2018, Intel Corporation.
* Copyright (c) 2020 by Lawrence Livermore National Security, LLC.
* Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
* Copyright (c) 2022, 2026 Hewlett Packard Enterprise Development LP.
* Copyright (c) 2024 by Delphix. All rights reserved.
*/

Expand Down Expand Up @@ -763,16 +763,16 @@ vdev_rebuild_thread(void *arg)
vdev_t *vd = arg;
spa_t *spa = vd->vdev_spa;
vdev_t *rvd = spa->spa_root_vdev;
dsl_pool_t *dp = spa_get_dsl(spa);
int error = 0;

/*
* If there's a scrub in process request that it be stopped. This
* is not required for a correct rebuild, but we do want rebuilds to
* emulate the resilver behavior as much as possible.
*/
dsl_pool_t *dsl = spa_get_dsl(spa);
if (dsl_scan_scrubbing(dsl))
dsl_scan_cancel(dsl);
if (dsl_scan_scrubbing(dp))
dsl_scan_cancel(dp);

spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
mutex_enter(&vd->vdev_rebuild_lock);
Expand Down Expand Up @@ -854,7 +854,7 @@ vdev_rebuild_thread(void *arg)
if (zfs_range_tree_space(msp->ms_allocating[j])) {
mutex_exit(&msp->ms_lock);
mutex_exit(&msp->ms_sync_lock);
txg_wait_synced(dsl, 0);
txg_wait_synced(dp, 0);
mutex_enter(&msp->ms_sync_lock);
mutex_enter(&msp->ms_lock);
break;
Expand Down Expand Up @@ -931,7 +931,6 @@ vdev_rebuild_thread(void *arg)

spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);

dsl_pool_t *dp = spa_get_dsl(spa);
dmu_tx_t *tx = dmu_tx_create_dd(dp->dp_mos_dir);
VERIFY0(dmu_tx_assign(tx, DMU_TX_WAIT | DMU_TX_SUSPEND));

Expand Down
Loading