]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/deep_copy: skip reading data from image cache 37750/head
authorlixiaoy1 <xiaoyan.li@intel.com>
Thu, 22 Oct 2020 14:44:43 +0000 (10:44 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 26 Oct 2020 20:10:37 +0000 (16:10 -0400)
Signed-off-by: Li, Xiaoyan <xiaoyan.li@intel.com>
src/librbd/cache/WriteLogImageDispatch.cc

index bf1831cbacfbd9891e3df2820dd4893aa0a27d9c..3fa04aac6fd061c3d471bf7dce011cd22a6aa173 100644 (file)
@@ -2,6 +2,7 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "common/dout.h"
+#include "include/neorados/RADOS.hpp"
 #include "librbd/cache/pwl/AbstractWriteLog.h"
 #include "librbd/cache/pwl/ShutdownRequest.h"
 #include "librbd/cache/WriteLogImageDispatch.h"
@@ -54,6 +55,10 @@ bool WriteLogImageDispatch<I>::read(
   auto cct = m_image_ctx->cct;
   ldout(cct, 20) << "image_extents=" << image_extents << dendl;
 
+  if (io_context->read_snap().value_or(CEPH_NOSNAP) != CEPH_NOSNAP) {
+    return false;
+  }
+
   *dispatch_result = io::DISPATCH_RESULT_COMPLETE;
   if (preprocess_length(aio_comp, image_extents)) {
     return true;