]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
tools/rados: fix "Floating point exception" if objectsize smaller than blocksize... 8671/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 21 Apr 2016 10:22:46 +0000 (18:22 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 21 Apr 2016 10:22:46 +0000 (18:22 +0800)
commitd81c7620411b37d85c27703489cfe08e41836130
tree3c4a546f5c933263f8937aafd97fa1a81db87d39
parenteff74daf9c53bcd86ff4f6f9c8958f9b04085fdf
tools/rados: fix "Floating point exception" if  objectsize smaller than blocksize when do write-bench.

When do write-bench, if objectsize is smaller than blocksize. It will
casue "Floating point exception".
This because in bjBencher::write_bench:
>>if (data.op_size)
>>    writes_per_object = data.object_size / data.op_size;
  It make writes_per_object = 0;
......
>> name[i] = generate_object_name(i / writes_per_object);
  i/0 cause Floating point exception.

If objectsize is smaller than blocksize, make blocksize is eqaul
objectsize.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/tools/rados/rados.cc