]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ObjectStore: Don't use largest_data_off to calc data_align. 3954/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 27 Oct 2014 03:22:13 +0000 (11:22 +0800)
committerLoic Dachary <ldachary@redhat.com>
Wed, 11 Mar 2015 09:35:35 +0000 (10:35 +0100)
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 <sage@redhat.com>
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
(cherry picked from commit a1aa70f2f21339feabfe9c1b3c9c9f97fbd53c9d)

src/os/ObjectStore.h

index a5f5fcb0b44180c835325ad0fef8cca7284ff5ad..921beaebd05c98c2ca0810d7857e64f8193687eb 100644 (file)
@@ -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() {