Merge pull request #6677 from jack-changtao/test-bench

rados: bench: fix off-by-one to avoid writing past object_size

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2015-12-03 06:38:19 -05:00
commit c80945fb60
2 changed files with 3 additions and 2 deletions

View File

@ -195,7 +195,8 @@ void Bencher::run_bench()
default: {
assert(0);
}
}
}
ops++;
}
drain_ops();
}

View File

@ -135,7 +135,7 @@ public:
boost::tuple<string, uint64_t, uint64_t, Bencher::OpType> ret =
boost::make_tuple(*object_pos, cur_pos, length, (*op_dist)());
cur_pos += length;
if (cur_pos > size) {
if (cur_pos >= size) {
cur_pos = 0;
++object_pos;
}