]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/BlueStore: For overwrite a extent, allocate new extent rather than WAL. 7996/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Wed, 9 Mar 2016 15:52:23 +0000 (23:52 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Wed, 9 Mar 2016 15:52:23 +0000 (23:52 +0800)
This bug introduce by commit:b0b4b6de362f0edf. This commit forget this
case which overwrite(0, bluestore_min_alloc_size).
For this case it  need a new extent rather than WAL.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc

index 72d139fa0058d04710ab171a177107c817d2d3cd..a3b1ce6e96ecc8750409e8c47607c7ff18fcd0b2 100644 (file)
@@ -5059,7 +5059,7 @@ int BlueStore::_do_allocate(
   bool shared_head = false;
   bool shared_tail = false;
   uint64_t orig_end = orig_offset + orig_length;
-  if (orig_offset / min_alloc_size == (orig_end - 1)/ min_alloc_size) {
+  if (orig_offset / min_alloc_size == (orig_end - 1)/ min_alloc_size && (orig_length != min_alloc_size)) {
     // we fall within the same block
     offset = orig_offset - orig_offset % min_alloc_size;
     length = 0;