From: Jianpeng Ma Date: Wed, 9 Mar 2016 15:52:23 +0000 (+0800) Subject: os/bluestore/BlueStore: For overwrite a extent, allocate new extent rather than WAL. X-Git-Tag: v10.1.0~202^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a5969e99ada86861b4cc23a71c82ab608ec3b81;p=ceph.git os/bluestore/BlueStore: For overwrite a extent, allocate new extent rather than WAL. 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 72d139fa005..a3b1ce6e96e 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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;