From f4bab86fe3b218d66c14d06883c297836d9ca19d Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Mon, 27 Oct 2014 11:22:13 +0800 Subject: [PATCH] ObjectStore: Don't use largest_data_off to calc data_align. If largest_data_off % CEPH_PAGE_SIZE != 0, the get_data_aligment return a erro value. This make the FileJouranl::align_bl to memcopy much data. Tested-by: Sage Weil Signed-off-by: Jianpeng Ma (cherry picked from commit a1aa70f2f21339feabfe9c1b3c9c9f97fbd53c9d) --- 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 a5f5fcb0b44..921beaebd05 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -511,7 +511,7 @@ public: int get_data_alignment() { if (!largest_data_len) return -1; - return (largest_data_off - get_data_offset()) & ~CEPH_PAGE_MASK; + return (0 - get_data_offset()) & ~CEPH_PAGE_MASK; } /// Is the Transaction empty (no operations) bool empty() { -- 2.47.3