diff options
author | George Amanakis <[email protected]> | 2023-02-24 02:14:52 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-02-23 18:14:52 -0700 |
commit | d816bc5ec76b050ab5319112320e1676d538161c (patch) | |
tree | 8c24fb4c5aa215d5266f83332652bfeb2a92faf1 /module/zfs/dsl_dataset.c | |
parent | 6109d83df86321a21a0f7ef543d71bdc62f075a6 (diff) |
Move dmu_buf_rele() after dsl_dataset_sync_done()
Otherwise the dataset may be freed after the last dmu_buf_rele() leading
to a panic.
Reviewed-by: Mark Maybee <[email protected]>
Reviewed-by: Matthew Ahrens <[email protected]>
Signed-off-by: George Amanakis <[email protected]>
Closes #14522
Closes #14523
Diffstat (limited to 'module/zfs/dsl_dataset.c')
-rw-r--r-- | module/zfs/dsl_dataset.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index 02eef6cda..3cc7d68eb 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -1272,9 +1272,6 @@ dsl_dataset_zero_zil(dsl_dataset_t *ds, dmu_tx_t *tx) zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED); dsl_dataset_sync(ds, zio, tx); VERIFY0(zio_wait(zio)); - - /* dsl_dataset_sync_done will drop this reference. */ - dmu_buf_add_ref(ds->ds_dbuf, ds); dsl_dataset_sync_done(ds, tx); } } @@ -2271,10 +2268,6 @@ dsl_dataset_sync_done(dsl_dataset_t *ds, dmu_tx_t *tx) else ASSERT0(os->os_next_write_raw[tx->tx_txg & TXG_MASK]); - ASSERT(!dmu_objset_is_dirty(os, dmu_tx_get_txg(tx))); - - dmu_buf_rele(ds->ds_dbuf, ds); - for (spa_feature_t f = 0; f < SPA_FEATURES; f++) { if (zfeature_active(f, ds->ds_feature_activation[f])) { @@ -2285,6 +2278,8 @@ dsl_dataset_sync_done(dsl_dataset_t *ds, dmu_tx_t *tx) ds->ds_feature[f] = ds->ds_feature_activation[f]; } } + + ASSERT(!dmu_objset_is_dirty(os, dmu_tx_get_txg(tx))); } int |