From 2aad3dee23b943bffb85680e468a223f9bcb153d Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 1 Dec 2025 13:30:27 -0500 Subject: [PATCH] DDT: Make children writes inherit allocator Even though unlike gang children it is not so critical for dedup children to inherit parent's allocator, there is still no reason for them to have allocation policy different from normal writes. Reviewed-by: Brian Behlendorf Reviewed-by: Rob Norris Signed-off-by: Alexander Motin Closes #17961 --- module/zfs/zio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 74373f759..d990d2dd6 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -3088,7 +3088,7 @@ zio_gang_issue(zio_t *zio) } static void -zio_gang_inherit_allocator(zio_t *pio, zio_t *cio) +zio_inherit_allocator(zio_t *pio, zio_t *cio) { cio->io_allocator = pio->io_allocator; } @@ -3223,7 +3223,7 @@ zio_write_gang_block(zio_t *pio, metaslab_class_t *mc) zio_write_gang_done, NULL, pio->io_priority, ZIO_GANG_CHILD_FLAGS(pio), &pio->io_bookmark); - zio_gang_inherit_allocator(pio, zio); + zio_inherit_allocator(pio, zio); if (pio->io_flags & ZIO_FLAG_ALLOC_THROTTLED) { boolean_t more; VERIFY(metaslab_class_throttle_reserve(mc, zio->io_allocator, @@ -3285,7 +3285,7 @@ zio_write_gang_block(zio_t *pio, metaslab_class_t *mc) (allocated ? ZIO_FLAG_PREALLOCATED : 0), &pio->io_bookmark); resid -= psize; - zio_gang_inherit_allocator(zio, cio); + zio_inherit_allocator(zio, cio); if (allocated) { metaslab_trace_move(&cio_list, &cio->io_alloc_list); metaslab_group_alloc_increment_all(spa, @@ -4062,6 +4062,7 @@ zio_ddt_write(zio_t *zio) zio_ddt_child_write_ready, NULL, zio_ddt_child_write_done, dde, zio->io_priority, ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark); + zio_inherit_allocator(zio, cio); zio_push_transform(cio, zio->io_abd, zio->io_size, 0, NULL);