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:
4885a6eba420ce216e4102df3e42229e167d1b7b ("engines/io_uring_cmd:
make trims async")
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
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;
}