From: Zhiqiang Wang Date: Thu, 18 Jun 2015 07:32:48 +0000 (+0800) Subject: osd: return ENOENT when object doesn't exist for cache pin/unpin X-Git-Tag: v10.0.0~62^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=478389924b9e1296d4b65e8cea6f64cb01cc5263;p=ceph.git osd: return ENOENT when object doesn't exist for cache pin/unpin Signed-off-by: Zhiqiang Wang --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 2402a2b6d9d..e012a1c6244 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5098,14 +5098,10 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) } ++ctx->num_write; { - if (!obs.exists) { - assert(!oi.is_cache_pinned()); - ctx->mod_desc.create(); - t->touch(soid); - ctx->delta_stats.num_objects++; - obs.exists = true; - obs.oi.new_object(); - } + if (!obs.exists || oi.is_whiteout()) { + result = -ENOENT; + break; + } if (!oi.is_cache_pinned()) { oi.set_flag(object_info_t::FLAG_CACHE_PIN); @@ -5127,10 +5123,10 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops) } ++ctx->num_write; { - if (!obs.exists) { - result = 0; + if (!obs.exists || oi.is_whiteout()) { + result = -ENOENT; break; - } + } if (oi.is_cache_pinned()) { oi.clear_flag(object_info_t::FLAG_CACHE_PIN);