From: myoungwon oh Date: Tue, 9 May 2017 04:35:11 +0000 (+0900) Subject: osd: handle IGNORE_REDIRECT X-Git-Tag: v12.1.0~57^2~9^2~2^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=402d747ada100636cd4ecb7b5d08887b8358f60d;p=ceph.git osd: handle IGNORE_REDIRECT Signed-off-by: Myoungwon Oh omwmw@sk.com --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index ff699a16d254..9a5adfb572d6 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -2251,6 +2251,12 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail( bool write_ordered, ObjectContextRef obc) { + if (static_cast(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& 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;