From 7250fb18fbe8c1c7757f490c63246e3d75a98421 Mon Sep 17 00:00:00 2001 From: Xiaoxi Chen Date: Mon, 14 Sep 2015 16:53:01 +0800 Subject: [PATCH] os/OSD.cc cast osd_max_write_size to int64_t Otherwise overflow may occur and negative values generated. Signed-off-by: Xiaoxi Chen --- src/osd/OSD.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.47.3