Skip to content

Commit

Permalink
engines/io_uring_cmd: allocate enough ranges for async trims
Browse files Browse the repository at this point in the history
We round up the iodepth to the next highest power of 2. So io_u->index
can be greater than the iodepth specified by the user. Make sure we
allocate enough of the buffers used to store the ranges for async trim
commands when the iodepth specified by the user is not a power of 2.

Fixes: 4885a6e ("engines/io_uring_cmd:
make trims async")
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Oct 25, 2023
1 parent c11e22e commit ecc734c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ static int fio_ioring_init(struct thread_data *td)
td->o.zone_mode == ZONE_MODE_ZBD)
td->io_ops->flags |= FIO_ASYNCIO_SYNC_TRIM;
else
ld->dsm = calloc(ld->iodepth, sizeof(*ld->dsm));
ld->dsm = calloc(td->o.iodepth, sizeof(*ld->dsm));

return 0;
}
Expand Down

0 comments on commit ecc734c

Please sign in to comment.