]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd: "rbd bench" always writes the same byte 59502/head
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:50:22 +0000 (08:50 +0200)
commit07dc1c5534224797bb38799b8e9d43327a12d00a
treecd26696aa3774f024fb6acf87b8fabb15392a2b2
parent7da380161880ff576c6e993811bedb7be289e82d
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