]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix dirty_range on _do_clone_range 16738/head
authorSage Weil <sage@redhat.com>
Tue, 1 Aug 2017 19:47:28 +0000 (15:47 -0400)
committerSage Weil <sage@redhat.com>
Tue, 1 Aug 2017 19:47:37 +0000 (15:47 -0400)
If we are cloning several extents that start from logical offset 0, we may
need to dirty those extents on the source object if they are being made
shared.  However, if there are two or more such extents, and the first
starts at 0, the current code will adjust dirty_range_start to the
second extent because the second time around the loop dirty_range_begin
is still 0.

Fix by adjusting the condition to be dirty_range_begin and dirty_range_end
== 0 so that it only triggers on the first pass.

Fixes: http://tracker.ceph.com/issues/20810
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 1ad6c81e6c389762b29f91beebad1742c294631f..3d9b695ffa960a56c29b663569534dfed24a62a4 100644 (file)
@@ -10928,7 +10928,7 @@ int BlueStore::_do_clone_range(
       // make sure it is shared
       if (!blob.is_shared()) {
        c->make_blob_shared(_assign_blobid(txc), e.blob);
-       if (dirty_range_begin == 0) {
+       if (dirty_range_begin == 0 && dirty_range_end == 0) {
           dirty_range_begin = e.logical_offset;
         }
         assert(e.logical_end() > 0);