From: Xiaoxi Chen Date: Mon, 14 Sep 2015 08:53:01 +0000 (+0800) Subject: os/OSD.cc cast osd_max_write_size to int64_t X-Git-Tag: v9.1.0~138^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5916%2Fhead;p=ceph.git os/OSD.cc cast osd_max_write_size to int64_t Otherwise overflow may occur and negative values generated. Signed-off-by: Xiaoxi Chen --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 46514f354c03..f5c0683d64db 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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)