From a1aa70f2f21339feabfe9c1b3c9c9f97fbd53c9d 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 --- 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 1043547a1c21f..6ea02edb407b1 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -525,7 +525,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.39.5