Skip to content

Commit 48351dc

Browse files
authored
Merge pull request ceph#59423 from idryomov/wip-67698
rbd: "rbd bench" always writes the same byte Reviewed-by: Mykola Golub <[email protected]>
2 parents 418b53c + 907e53a commit 48351dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tools/rbd/action/Bench.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ int do_bench(librbd::Image& image, io_type_t io_type,
233233
return r;
234234
}
235235

236+
// seed rand() before constructing rbd_bencher
237+
srand(time(NULL) % (unsigned long) -1);
238+
236239
rbd_bencher b(&image, io_type, io_size);
237240

238241
std::cout << "bench "
@@ -261,8 +264,6 @@ int do_bench(librbd::Image& image, io_type_t io_type,
261264
}
262265
std::cout << std::endl;
263266

264-
srand(time(NULL) % (unsigned long) -1);
265-
266267
coarse_mono_time start = coarse_mono_clock::now();
267268
std::chrono::duration<double> last = std::chrono::duration<double>::zero();
268269
uint64_t ios = 0;

0 commit comments

Comments
 (0)