It's expected that the buffer is filled with the same byte, but the
byte should differ from run to run:
memset(bp.c_str(), rand() & 0xff, io_size);
This was broken in commit
c7f71d14a5d3 ("rbd: migrated existing command
logic to new namespaces") which inadvertently moved the call to srand(),
leaving rand() unseeded for the above memset().
Fixes: https://tracker.ceph.com/issues/67698
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
return r;
}
+ // seed rand() before constructing rbd_bencher
+ srand(time(NULL) % (unsigned long) -1);
+
rbd_bencher b(&image, io_type, io_size);
std::cout << "bench "
}
std::cout << std::endl;
- srand(time(NULL) % (unsigned long) -1);
-
coarse_mono_time start = coarse_mono_clock::now();
std::chrono::duration<double> last = std::chrono::duration<double>::zero();
uint64_t ios = 0;