Skip to content

Commit

Permalink
remove redundant race condition fix
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Dagnelie <[email protected]>
  • Loading branch information
pcd1193182 committed Sep 26, 2023
1 parent cea5128 commit 9574a60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6754,6 +6754,7 @@ zdb_brt_entry_compare(const void *zcn1, const void *zcn2)
return (cmp);
}

static int
chain_map_count_blk_cb(spa_t *spa, const blkptr_t *bp, void *arg)
{
(void) spa;
Expand Down
11 changes: 3 additions & 8 deletions module/zfs/zil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,6 @@ zil_lwb_flush_defer(lwb_t *lwb, lwb_t *nlwb)
* future writes to additional vdevs.
*/
mutex_enter(&nlwb->lwb_vdev_lock);
mutex_exit(&lwb->lwb_zilog->zl_lock);
/*
* Tear down the 'lwb' vdev tree, ensuring that entries which do not
* exist in 'nlwb' are moved to it, freeing any would-be duplicates.
Expand Down Expand Up @@ -1641,10 +1640,10 @@ zil_lwb_write_done(zio_t *zio)
nlwb = list_next(&zilog->zl_lwb_list, lwb);
if (nlwb && nlwb->lwb_state != LWB_STATE_ISSUED)
nlwb = NULL;
if (avl_numnodes(t) == 0) {
mutex_exit(&zilog->zl_lock);
mutex_exit(&zilog->zl_lock);

if (avl_numnodes(t) == 0)
return;
}

/*
* If there was an IO error, we're not going to call zio_flush()
Expand All @@ -1660,7 +1659,6 @@ zil_lwb_write_done(zio_t *zio)
* that function).
*/
if (zio->io_error != 0) {
mutex_exit(&zilog->zl_lock);
while ((zv = avl_destroy_nodes(t, &cookie)) != NULL)
kmem_free(zv, sizeof (*zv));
return;
Expand All @@ -1686,8 +1684,6 @@ zil_lwb_write_done(zio_t *zio)
ASSERT(avl_is_empty(&lwb->lwb_vdev_tree));
return;
}
mutex_enter(&lwb->lwb_vdev_lock);
mutex_exit(&zilog->zl_lock);

while ((zv = avl_destroy_nodes(t, &cookie)) != NULL) {
vdev_t *vd = vdev_lookup_top(spa, zv->zv_vdev);
Expand All @@ -1704,7 +1700,6 @@ zil_lwb_write_done(zio_t *zio)
}
kmem_free(zv, sizeof (*zv));
}
mutex_exit(&lwb->lwb_vdev_lock);
}

/*
Expand Down

0 comments on commit 9574a60

Please sign in to comment.