aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Wilson <[email protected]>2023-03-28 11:13:32 -0400
committerGitHub <[email protected]>2023-03-28 08:13:32 -0700
commita604d3243b0f29ac0a93fc39ece8850f03419d22 (patch)
treeab626138b409556cd5472e22e87963ac2a35605f
parentaebd94cc8541e0ec3b1de57edbd57c4280213089 (diff)
Revert "Do not hold spa_config in ZIL while blocked on IO"
This reverts commit 7d638df09be7482935bcf6ec8e4ea2ac8a8be1a8. Reviewed-by: Prakash Surya <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: George Wilson <[email protected]> Closes #14678
-rw-r--r--module/zfs/zil.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/module/zfs/zil.c b/module/zfs/zil.c
index fba1c1999..eb26e4b32 100644
--- a/module/zfs/zil.c
+++ b/module/zfs/zil.c
@@ -1384,6 +1384,8 @@ zil_lwb_flush_vdevs_done(zio_t *zio)
itx_t *itx;
uint64_t txg;
+ spa_config_exit(zilog->zl_spa, SCL_STATE, lwb);
+
zio_buf_free(lwb->lwb_buf, lwb->lwb_sz);
mutex_enter(&zilog->zl_lock);
@@ -1522,6 +1524,8 @@ zil_lwb_write_done(zio_t *zio)
zil_vdev_node_t *zv;
lwb_t *nlwb;
+ ASSERT3S(spa_config_held(spa, SCL_STATE, RW_READER), !=, 0);
+
ASSERT(BP_GET_COMPRESS(zio->io_bp) == ZIO_COMPRESS_OFF);
ASSERT(BP_GET_TYPE(zio->io_bp) == DMU_OT_INTENT_LOG);
ASSERT(BP_GET_LEVEL(zio->io_bp) == 0);
@@ -1583,7 +1587,6 @@ zil_lwb_write_done(zio_t *zio)
return;
}
- spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
while ((zv = avl_destroy_nodes(t, &cookie)) != NULL) {
vdev_t *vd = vdev_lookup_top(spa, zv->zv_vdev);
if (vd != NULL) {
@@ -1599,7 +1602,6 @@ zil_lwb_write_done(zio_t *zio)
}
kmem_free(zv, sizeof (*zv));
}
- spa_config_exit(spa, SCL_STATE, FTAG);
}
static void
@@ -1878,6 +1880,8 @@ zil_lwb_write_issue(zilog_t *zilog, lwb_t *lwb)
*/
memset(lwb->lwb_buf + lwb->lwb_nused, 0, wsz - lwb->lwb_nused);
+ spa_config_enter(zilog->zl_spa, SCL_STATE, lwb, RW_READER);
+
zil_lwb_add_block(lwb, &lwb->lwb_blk);
lwb->lwb_issued_timestamp = gethrtime();
lwb->lwb_state = LWB_STATE_ISSUED;