From: Jianpeng Ma Date: Mon, 27 Oct 2014 03:22:13 +0000 (+0800) Subject: ObjectStore: Don't use largest_data_off to calc data_align. X-Git-Tag: v0.80.10~63^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f4bab86fe3b218d66c14d06883c297836d9ca19d;p=ceph.git 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) --- 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() {