From: Igor Fedotov Date: Tue, 11 Jun 2019 17:05:09 +0000 (+0300) Subject: os/bluestore: fix duplicate allocations in bmap allocator X-Git-Tag: v12.2.13~170^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19d11f51cfc704def2bc6062bf81f4676b4dfb6c;p=ceph.git os/bluestore: fix duplicate allocations in bmap allocator Fixes: http://tracker.ceph.com/issues/40080 Signed-off-by: Igor Fedotov (cherry picked from commit eac81bc85970287fce60178e80c37628b3df0e7d) Conflicts: src/os/bluestore/fastbmap_allocator_impl.cc ceph_assert vs. assert mismatch --- diff --git a/src/os/bluestore/fastbmap_allocator_impl.cc b/src/os/bluestore/fastbmap_allocator_impl.cc index 1eff326d4f4a..a46cbc79a7e4 100755 --- a/src/os/bluestore/fastbmap_allocator_impl.cc +++ b/src/os/bluestore/fastbmap_allocator_impl.cc @@ -363,7 +363,7 @@ interval_t AllocatorLevel01Loose::_allocate_l1_contiguous(uint64_t length, if (ctx.affordable_len) { assert(ctx.affordable_len >= length); assert((length % l0_granularity) == 0); - auto pos_start = ctx.affordable_offs + length / l0_granularity; + auto pos_start = ctx.affordable_offs / l0_granularity; auto pos_end = (ctx.affordable_offs + length) / l0_granularity; _mark_alloc_l1_l0(pos_start, pos_end); res = interval_t(ctx.affordable_offs, length);