From 5a5969e99ada86861b4cc23a71c82ab608ec3b81 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Wed, 9 Mar 2016 23:52:23 +0800 Subject: [PATCH] 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 --- src/os/bluestore/BlueStore.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 72d139fa0058d..a3b1ce6e96ecc 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; -- 2.39.5