]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/OSD.cc cast osd_max_write_size to int64_t 5916/head
authorXiaoxi Chen <xiaoxi.chen@intel.com>
Mon, 14 Sep 2015 08:53:01 +0000 (16:53 +0800)
committerXiaoxi Chen <xiaoxi.chen@intel.com>
Tue, 15 Sep 2015 01:33:35 +0000 (09:33 +0800)
Otherwise overflow may occur and negative values generated.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
src/osd/OSD.cc

index 46514f354c03c87737336fa5daa4529ecb945109..f5c0683d64db773da0a2bb239e0def3cf022ad87 100644 (file)
@@ -8105,7 +8105,7 @@ void OSD::handle_op(OpRequestRef& op, OSDMapRef& osdmap)
 
     // too big?
     if (cct->_conf->osd_max_write_size &&
-       m->get_data_len() > cct->_conf->osd_max_write_size << 20) {
+       m->get_data_len() > ((int64_t)g_conf->osd_max_write_size) << 20) {
       // journal can't hold commit!
       derr << "handle_op msg data len " << m->get_data_len()
           << " > osd_max_write_size " << (cct->_conf->osd_max_write_size << 20)