]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: return ENOENT when object doesn't exist for cache pin/unpin
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Thu, 18 Jun 2015 07:32:48 +0000 (15:32 +0800)
committerSage Weil <sage@redhat.com>
Tue, 20 Oct 2015 14:36:09 +0000 (10:36 -0400)
Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
src/osd/ReplicatedPG.cc

index 2402a2b6d9dee4262352197fa2a12866d3426fce..e012a1c62449465f298cb5a3471a5f6d4c0aed5e 100644 (file)
@@ -5098,14 +5098,10 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& 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<OSDOp>& 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);