diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index c40cb6f0796..c84c2098fd0 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5586,6 +5586,9 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector& cmd, buffe } } + if (osize && bsize > osize) + bsize = osize; + dout(1) << " bench count " << count << " bsize " << prettybyte_t(bsize) << dendl; diff --git a/src/test/osd/osd-bench.sh b/src/test/osd/osd-bench.sh index ac40cb0d8cd..f14a35152f7 100755 --- a/src/test/osd/osd-bench.sh +++ b/src/test/osd/osd-bench.sh @@ -77,6 +77,16 @@ function TEST_bench() { # default values should work # ceph tell osd.0 bench || return 1 + + # + # test object_size < block_size + ceph tell osd.0 bench 10 14456 4444 3 + # + + # + # test object_size < block_size & object_size = 0(default value) + # + ceph tell osd.0 bench 1 14456 } main osd-bench "$@"