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.89~64 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a1aa70f2f21339feabfe9c1b3c9c9f97fbd53c9d;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 --- diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 1043547a1c21..6ea02edb407b 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() {