From db79734cd10335ccdc631b87393c07af9b4bf02b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 4 Aug 2017 10:27:54 -0400 Subject: [PATCH] os/bluestore: fix dirty_shard off-by-one If we dirty an extent that abuts the end of a shard, we should not dirty the next shard too. Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e28f6e757fa..d4d95b3ab68 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -2676,7 +2676,10 @@ void BlueStore::ExtentMap::dirty_range( return; } auto start = seek_shard(offset); - auto last = seek_shard(offset + length); + if (length == 0) { + length = 1; + } + auto last = seek_shard(offset + length - 1); if (start < 0) return; -- 2.39.5