Fixes:
src/common/obj_bencher.cc b/src/common/obj_bencher.cc :write_bench(),seq_read_bench(),rand_read_bench()
the program may fall into a dead loop if the <seconds> set as 0
Signed-off-by:PCzhangPC pengcheng.zhang@easystack.cn
stopTime = data.start_time + runtime;
slot = 0;
lock.Lock();
- while (!secondsToRun || ceph_clock_now() < stopTime) {
+ while (secondsToRun && ceph_clock_now() < stopTime) {
bool found = false;
while (1) {
int old_slot = slot;
bufferlist *cur_contents;
slot = 0;
- while ((!seconds_to_run || ceph_clock_now() < finish_time) &&
+ while ((seconds_to_run && ceph_clock_now() < finish_time) &&
num_objects > data.started) {
lock.Lock();
int old_slot = slot;
int rand_id;
slot = 0;
- while ((!seconds_to_run || ceph_clock_now() < finish_time)) {
+ while ((seconds_to_run && ceph_clock_now() < finish_time)) {
lock.Lock();
int old_slot = slot;
bool found = false;