Skip to content

Commit

Permalink
Merge pull request #6677 from jack-changtao/test-bench
Browse files Browse the repository at this point in the history
rados: bench: fix off-by-one to avoid writing past object_size

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
liewegas committed Dec 3, 2015
2 parents eb82a85 + 574e319 commit c80945f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/test/bench/bencher.cc
Expand Up @@ -195,7 +195,8 @@ void Bencher::run_bench()
default: {
assert(0);
}
}
}
ops++;
}
drain_ops();
}
2 changes: 1 addition & 1 deletion src/test/bench/bencher.h
Expand Up @@ -135,7 +135,7 @@ class SequentialLoad :
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;
}
Expand Down

0 comments on commit c80945f

Please sign in to comment.