Skip to content

Commit

Permalink
librbd/deep_copy: skip reading data from image cache
Browse files Browse the repository at this point in the history
Signed-off-by: Li, Xiaoyan <xiaoyan.li@intel.com>
  • Loading branch information
lixiaoy1 authored and Jason Dillaman committed Oct 26, 2020
1 parent ec64935 commit b1f1193
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/librbd/cache/WriteLogImageDispatch.cc
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b1f1193

Please sign in to comment.