From: jhonxue Date: Thu, 12 Nov 2020 15:17:13 +0000 (+0800) Subject: osd: fix bluestore bitmap allocator calculated wrong last_pos with hint X-Git-Tag: v14.2.17~23^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8511d16bab442844a92bc2f3bb3a153758fe094b;p=ceph.git osd: fix bluestore bitmap allocator calculated wrong last_pos with hint Fixes: https://tracker.ceph.com/issues/48214 Signed-off-by: Xue Yantao (cherry picked from commit ad3c7cdf6fabbb4a8b542b793d632cae87ee3640) --- diff --git a/src/os/bluestore/fastbmap_allocator_impl.h b/src/os/bluestore/fastbmap_allocator_impl.h index ed2d4c8cc98ce..52a1edee2f8a6 100755 --- a/src/os/bluestore/fastbmap_allocator_impl.h +++ b/src/os/bluestore/fastbmap_allocator_impl.h @@ -708,7 +708,7 @@ protected: return; } if (hint != 0) { - last_pos = (hint / d) < l2.size() ? p2align(hint, d) : 0; + last_pos = (hint / (d * l2_granularity)) < l2.size() ? p2align(hint / l2_granularity, d) : 0; } auto l2_pos = last_pos; auto last_pos0 = last_pos;