]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: handle IGNORE_REDIRECT
authormyoungwon oh <omwmw@sk.com>
Tue, 9 May 2017 04:35:11 +0000 (13:35 +0900)
committermyoungwon oh <omwmw@sk.com>
Tue, 16 May 2017 20:38:49 +0000 (05:38 +0900)
Signed-off-by: Myoungwon Oh omwmw@sk.com
src/osd/PrimaryLogPG.cc

index ff699a16d2549bad624f3e1084ef3784ad4a2291..9a5adfb572d608d15d7661b64c8b6173c2aefae2 100644 (file)
@@ -2251,6 +2251,12 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
   bool write_ordered,
   ObjectContextRef obc)
 {
+  if (static_cast<const MOSDOp *>(op->get_req())->get_flags() &
+      CEPH_OSD_FLAG_IGNORE_REDIRECT) {
+    dout(20) << __func__ << ": ignoring redirect due to flag" << dendl;
+    return cache_result_t::NOOP;
+  }
+
   if (obc)
     dout(10) << __func__ << " " << obc->obs.oi << " "
        << (obc->obs.exists ? "exists" : "DNE")
@@ -5790,6 +5796,11 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          result = -EINVAL;
          break;
        }
+       if (!obs.exists) {
+         result = -ENOENT;
+         break;
+       }
+
        object_t target_name;
        object_locator_t target_oloc;
        snapid_t target_snapid = (uint64_t)op.copy_from.snapid;