mirror of
https://github.com/ceph/ceph
synced 2025-01-12 14:10:27 +00:00
osd/OSD: fix Floating point exception.
When do 'ceph tell osd.x bench', if block_size is larger than object_size, it will cause Floating point exception. For this case, set block_size = object_size(expect object_size = 0). Also add related test-case. Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
This commit is contained in:
parent
eac6b844d9
commit
c326702bfd
@ -5586,6 +5586,9 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector<string>& cmd, buffe
|
||||
}
|
||||
}
|
||||
|
||||
if (osize && bsize > osize)
|
||||
bsize = osize;
|
||||
|
||||
dout(1) << " bench count " << count
|
||||
<< " bsize " << prettybyte_t(bsize) << dendl;
|
||||
|
||||
|
@ -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 "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user