From 0c93d86f01e509cdfab271fa285497cbda4e3a9f Mon Sep 17 00:00:00 2001 From: Serapheim Dimitropoulos Date: Mon, 1 May 2023 17:18:42 -0700 Subject: [PATCH] Correct ABD size for split block ZIOs Currently when layering the ABD buffer of each split block on top of an indirect vdev's ZIO ABD we don't specify the split block's ABD. This results in those ABDs being incorrectly sized by inheriting the size of their parent ABD which is larger than what each split block needs. The above behavior isn't causing any bugs currently but can lead to unexpected ABD sizes for people analyzing and/or working on the ZIO codepath. This patch fixes this behavior by properly setting the ABD size for split block ZIOs. Reviewed-by: Matthew Ahrens Reviewed-by: Igor Kozhukhov Reviewed-by: Brian Behlendorf Reviewed-by: Mark Maybee Reviewed-by: Brian Atkinson Signed-off-by: Serapheim Dimitropoulos Closes #14804 --- module/zfs/vdev_indirect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/zfs/vdev_indirect.c b/module/zfs/vdev_indirect.c index 8c11a574a..a16ad2f4e 100644 --- a/module/zfs/vdev_indirect.c +++ b/module/zfs/vdev_indirect.c @@ -1370,9 +1370,10 @@ vdev_indirect_io_start(zio_t *zio) is != NULL; is = list_next(&iv->iv_splits, is)) { zio_nowait(zio_vdev_child_io(zio, NULL, is->is_vdev, is->is_target_offset, - abd_get_offset(zio->io_abd, - is->is_split_offset), is->is_size, - zio->io_type, zio->io_priority, 0, + abd_get_offset_size(zio->io_abd, + is->is_split_offset, is->is_size), + is->is_size, zio->io_type, + zio->io_priority, 0, vdev_indirect_child_io_done, zio)); }