]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: fix dirty_shard off-by-one
authorSage Weil <sage@redhat.com>
Fri, 4 Aug 2017 14:27:54 +0000 (10:27 -0400)
committerSage Weil <sage@redhat.com>
Sun, 6 Aug 2017 14:33:04 +0000 (10:33 -0400)
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 <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index e28f6e757faeb26d3dcfb0858b4ed26ad7f2b4c0..d4d95b3ab68f6e2356e724e2f54739cb1dd11cc6 100644 (file)
@@ -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;