diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 2ae42e2df..9ae245866 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -724,7 +724,9 @@ zio_notify_parent(zio_t *pio, zio_t *zio, enum zio_wait_type wait, /* * If we can tell the caller to execute this parent next, do - * so. Otherwise dispatch the parent zio as its own task. + * so. We only do this if the parent's zio type matches the + * child's type. Otherwise dispatch the parent zio in its + * own taskq. * * Having the caller execute the parent when possible reduces * locking on the zio taskq's, reduces context switch @@ -743,7 +745,8 @@ zio_notify_parent(zio_t *pio, zio_t *zio, enum zio_wait_type wait, * parent-child relationships, as we do with the "mega zio" * of writes for spa_sync(), and the chain of ZIL blocks. */ - if (next_to_executep != NULL && *next_to_executep == NULL) { + if (next_to_executep != NULL && *next_to_executep == NULL && + pio->io_type == zio->io_type) { *next_to_executep = pio; } else { zio_taskq_dispatch(pio, type, B_FALSE);