In the old ceph version, buffer advance length was defined as int, but
in async msg, the real length of data buffer was defined as unsigned.
Occassionly some MDS message back from OSD was too large, which caused
this length overflow and made MDS crash.
For compatibility reason, add an assertion here if buffer advance length
is overflow.
Fixes: http://tracker.ceph.com/issues/36340
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
bufferptr bp = data_blp.get_current_ptr();
unsigned read_len = std::min(bp.length(), msg_left);
+ ceph_assert(read_len < std::numeric_limits<int>::max());
data_blp.advance(read_len);
data.append(bp, 0, read_len);
msg_left -= read_len;