]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rbd: "rbd bench" always writes the same byte
authorIlya Dryomov <idryomov@gmail.com>
Fri, 23 Aug 2024 21:00:24 +0000 (23:00 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 29 Aug 2024 06:49:15 +0000 (08:49 +0200)
commitf23b41ed7a6e4f0996d090929ed3690cc47c15f1
tree0199046b613dc3d12c4ab16077fc1507bb288be6
parent8189f9ea626f96dc1787c96b5303b48055a9318b
rbd: "rbd bench" always writes the same byte

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>
(cherry picked from commit 907e53aa8524971e3d969ec519953cdd3d83871f)
src/tools/rbd/action/Bench.cc