From bfdf4387900368253902c82fdd13412829aa4ae2 Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Mon, 23 Oct 2017 16:25:09 +0800 Subject: [PATCH] os/ObjectStore: fix get_data_alignment return -1 causing problem in msg header sizeof(data_off) in ceph_msg_header is uint16_t, so -1 will be 65535. When peer side receive MOSDRepOp message, it will allocate extra 1 byte buffer to store nonexisted buffer. Signed-off-by: Haomai Wang --- src/os/ObjectStore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 65df8ec08ebc..9eff1ff0db14 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -853,7 +853,7 @@ public: /// offset of buffer as aligned to destination within object. int get_data_alignment() { if (!data.largest_data_len) - return -1; + return 0; return (0 - get_data_offset()) & ~CEPH_PAGE_MASK; } /// Is the Transaction empty (no operations) -- 2.47.3