mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
ZIL: Tune some assertions.
In zil_free_lwb() we should first assert lwb_state or the rest of assertions can be misleading if it is false. Add lwb_state assertions in zil_lwb_add_block() to make sure we are not trying to add elements to lwb_vdev_tree after it was processed. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Sponsored by: iXsystems, Inc. Closes #15227
This commit is contained in:
parent
400f56e3f8
commit
5a7cb0b065
@ -814,17 +814,17 @@ static void
|
|||||||
zil_free_lwb(zilog_t *zilog, lwb_t *lwb)
|
zil_free_lwb(zilog_t *zilog, lwb_t *lwb)
|
||||||
{
|
{
|
||||||
ASSERT(MUTEX_HELD(&zilog->zl_lock));
|
ASSERT(MUTEX_HELD(&zilog->zl_lock));
|
||||||
ASSERT(!MUTEX_HELD(&lwb->lwb_vdev_lock));
|
ASSERT(lwb->lwb_state == LWB_STATE_NEW ||
|
||||||
VERIFY(list_is_empty(&lwb->lwb_waiters));
|
lwb->lwb_state == LWB_STATE_FLUSH_DONE);
|
||||||
VERIFY(list_is_empty(&lwb->lwb_itxs));
|
|
||||||
ASSERT(avl_is_empty(&lwb->lwb_vdev_tree));
|
|
||||||
ASSERT3P(lwb->lwb_child_zio, ==, NULL);
|
ASSERT3P(lwb->lwb_child_zio, ==, NULL);
|
||||||
ASSERT3P(lwb->lwb_write_zio, ==, NULL);
|
ASSERT3P(lwb->lwb_write_zio, ==, NULL);
|
||||||
ASSERT3P(lwb->lwb_root_zio, ==, NULL);
|
ASSERT3P(lwb->lwb_root_zio, ==, NULL);
|
||||||
ASSERT3U(lwb->lwb_alloc_txg, <=, spa_syncing_txg(zilog->zl_spa));
|
ASSERT3U(lwb->lwb_alloc_txg, <=, spa_syncing_txg(zilog->zl_spa));
|
||||||
ASSERT3U(lwb->lwb_max_txg, <=, spa_syncing_txg(zilog->zl_spa));
|
ASSERT3U(lwb->lwb_max_txg, <=, spa_syncing_txg(zilog->zl_spa));
|
||||||
ASSERT(lwb->lwb_state == LWB_STATE_NEW ||
|
VERIFY(list_is_empty(&lwb->lwb_itxs));
|
||||||
lwb->lwb_state == LWB_STATE_FLUSH_DONE);
|
VERIFY(list_is_empty(&lwb->lwb_waiters));
|
||||||
|
ASSERT(avl_is_empty(&lwb->lwb_vdev_tree));
|
||||||
|
ASSERT(!MUTEX_HELD(&lwb->lwb_vdev_lock));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear the zilog's field to indicate this lwb is no longer
|
* Clear the zilog's field to indicate this lwb is no longer
|
||||||
@ -1329,6 +1329,9 @@ zil_lwb_add_block(lwb_t *lwb, const blkptr_t *bp)
|
|||||||
int ndvas = BP_GET_NDVAS(bp);
|
int ndvas = BP_GET_NDVAS(bp);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
ASSERT3S(lwb->lwb_state, !=, LWB_STATE_WRITE_DONE);
|
||||||
|
ASSERT3S(lwb->lwb_state, !=, LWB_STATE_FLUSH_DONE);
|
||||||
|
|
||||||
if (zil_nocacheflush)
|
if (zil_nocacheflush)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user