bdev/raid: fix order of operations bug in UT

Identified in earlier unrelated patch.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I890ce3d3411fd4e4b3d5d8a15616b5b39dc13a0e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455733
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
paul luse 2019-05-25 08:57:49 -07:00 committed by Changpeng Liu
parent cac906f322
commit 5dc25edde0

View File

@ -1469,7 +1469,7 @@ test_write_io(void)
io_len = (g_strip_size / 2) << i;
bdev_io_initialize(bdev_io, &pbdev->bdev, lba, io_len, SPDK_BDEV_IO_TYPE_WRITE);
lba += g_strip_size;
memset(g_io_output, 0, (g_max_io_size / g_strip_size) + 1 * sizeof(struct io_output));
memset(g_io_output, 0, ((g_max_io_size / g_strip_size) + 1) * sizeof(struct io_output));
g_io_output_index = 0;
raid_bdev_submit_request(ch, bdev_io);
verify_io(bdev_io, req.base_bdevs.num_base_bdevs, ch_ctx, pbdev,
@ -1548,7 +1548,7 @@ test_read_io(void)
io_len = (g_strip_size / 2) << i;
bdev_io_initialize(bdev_io, &pbdev->bdev, lba, io_len, SPDK_BDEV_IO_TYPE_READ);
lba += g_strip_size;
memset(g_io_output, 0, (g_max_io_size / g_strip_size) + 1 * sizeof(struct io_output));
memset(g_io_output, 0, ((g_max_io_size / g_strip_size) + 1) * sizeof(struct io_output));
g_io_output_index = 0;
raid_bdev_submit_request(ch, bdev_io);
verify_io(bdev_io, req.base_bdevs.num_base_bdevs, ch_ctx, pbdev,
@ -1782,7 +1782,7 @@ test_io_failure(void)
io_len = (g_strip_size / 2) << count;
bdev_io_initialize(bdev_io, &pbdev->bdev, lba, io_len, SPDK_BDEV_IO_TYPE_INVALID);
lba += g_strip_size;
memset(g_io_output, 0, (g_max_io_size / g_strip_size) + 1 * sizeof(struct io_output));
memset(g_io_output, 0, ((g_max_io_size / g_strip_size) + 1) * sizeof(struct io_output));
g_io_output_index = 0;
raid_bdev_submit_request(ch, bdev_io);
verify_io(bdev_io, req.base_bdevs.num_base_bdevs, ch_ctx, pbdev,
@ -1800,7 +1800,7 @@ test_io_failure(void)
io_len = (g_strip_size / 2) << count;
bdev_io_initialize(bdev_io, &pbdev->bdev, lba, io_len, SPDK_BDEV_IO_TYPE_WRITE);
lba += g_strip_size;
memset(g_io_output, 0, (g_max_io_size / g_strip_size) + 1 * sizeof(struct io_output));
memset(g_io_output, 0, ((g_max_io_size / g_strip_size) + 1) * sizeof(struct io_output));
g_io_output_index = 0;
raid_bdev_submit_request(ch, bdev_io);
verify_io(bdev_io, req.base_bdevs.num_base_bdevs, ch_ctx, pbdev,
@ -2191,7 +2191,7 @@ test_multi_raid_with_io(void)
SPDK_CU_ASSERT_FATAL(bdev_io != NULL);
io_len = g_strip_size;
iotype = (i) ? SPDK_BDEV_IO_TYPE_WRITE : SPDK_BDEV_IO_TYPE_READ;
memset(g_io_output, 0, (g_max_io_size / g_strip_size) + 1 * sizeof(struct io_output));
memset(g_io_output, 0, ((g_max_io_size / g_strip_size) + 1) * sizeof(struct io_output));
g_io_output_index = 0;
TAILQ_FOREACH(pbdev, &g_raid_bdev_list, global_link) {
if (strcmp(pbdev->bdev.name, construct_req[i].name) == 0) {