]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd: "rbd bench" always writes the same byte 59500/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:47:41 +0000 (08:47 +0200)
commit73821266d9dcf4dd83266b7cd25fa2dbd5cf4adc
treed0a34b33a46cc3e88bc959ffb6f7148262298bf2
parenta89f613db4d5b6bca82681f19d73c6d337aae2d5
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