]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: deep_copy: update end_size only if zero interval caused truncate
authorMykola Golub <mgolub@suse.com>
Tue, 19 Jun 2018 12:05:27 +0000 (15:05 +0300)
committerMykola Golub <mgolub@suse.com>
Tue, 19 Jun 2018 13:27:21 +0000 (16:27 +0300)
The problem shown up when stripping was used, and assembling a
nonexistent destination object from source objects, and one of these
objects existed and snap diff returned a zero interval. The non-zero
end_size in that case triggered invalid object map update.

Signed-off-by: Mykola Golub <mgolub@suse.com>
src/librbd/deep_copy/ObjectCopyRequest.cc

index 5fb70c7f37c8c367fc2bc492bbcabcb66e8abcf9..440cdbed035dceb4eab3030ead4513ab494facdc 100644 (file)
@@ -887,7 +887,7 @@ void ObjectCopyRequest<I>::compute_zero_ops() {
             ldout(m_cct, 20) << "COPY_OP_TYPE_TRUNC " << z.get_start() << dendl;
           }
         }
-        end_size = z.get_start();
+        end_size = std::min(end_size, z.get_start());
       } else {
         // zero interval inside the object
         m_write_ops[src_snap_seq]