]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ObjectStore: Don't use largest_data_off to calc data_align.
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 27 Oct 2014 03:22:13 +0000 (11:22 +0800)
committerSage Weil <sage@redhat.com>
Wed, 5 Nov 2014 13:14:14 +0000 (05:14 -0800)
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>
src/os/ObjectStore.h

index 1043547a1c21f6a37efd5bcd8fb447f2abd635b3..6ea02edb407b151bac3ee2e9cdb3b7f6ead42375 100644 (file)
@@ -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() {