From fae03566979e70bdfe2183cf011e3c2742f0a2e3 Mon Sep 17 00:00:00 2001 From: paul luse Date: Thu, 12 Mar 2020 14:55:52 +0000 Subject: [PATCH] test/bdevperf: fix issue with overlapping I/Os A previous fix for miscompare had a slight issue with the scenario where we chose an offset and then discover that it's already taken because we've wrapped to this location before the previous IO completed. In such case, we intended to bump the offset to just go to the next block however we only bumped the local variable so the next IO submitted will overwrite the previous. The fix is simply to use the previously incremented target->offset and increment it again for the next IO. Signed-off-by: paul luse Change-Id: I26661eb0631ac50cc4f86f42f1d1789d297e204d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1250 Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- test/bdev/bdevperf/bdevperf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/bdev/bdevperf/bdevperf.c b/test/bdev/bdevperf/bdevperf.c index 07df70bc5..703df4f06 100644 --- a/test/bdev/bdevperf/bdevperf.c +++ b/test/bdev/bdevperf/bdevperf.c @@ -692,7 +692,7 @@ bdevperf_submit_single(struct io_target *target, struct bdevperf_task *task) */ if (g_verify && spdk_bit_array_get(target->outstanding, offset_in_ios)) { do { - offset_in_ios++; + offset_in_ios = target->offset_in_ios++; if (target->offset_in_ios == target->size_in_ios) { target->offset_in_ios = 0; }