]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: remove unnecessary ref handling in _delete_oid
authormyoungwon oh <ohmyoungwon@gmail.com>
Wed, 31 Mar 2021 06:22:01 +0000 (15:22 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Thu, 8 Apr 2021 08:35:59 +0000 (17:35 +0900)
Let's consider the following case when handling a delete op.
1. Delete --> whiteouted
2. Make clone

In this case, current code clears chunk_map and calls dec_all_manifest_refcount()
in _delete_oid() even if the clone still has the references.

To fix this, This commit remove unnecessary ref handling in _delete_oid, and
makes finish_ctx() to handle ref handling, which can aware of whether the
clone is created or not.

Also, remove oi.size == 0 condition in finish_ctx() to handle ref. counting
upon a delete op with whitedouted clone.

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/osd/PrimaryLogPG.cc

index 68ec1f682e600ac71f8c1b7e9489abdf8d62d71a..c0968d008347018815a0e5129fb1c5d92496a6e8 100644 (file)
@@ -8178,14 +8178,6 @@ inline int PrimaryLogPG::_delete_oid(
     oi.set_flag(object_info_t::FLAG_WHITEOUT);
     ctx->delta_stats.num_whiteouts++;
     t->create(soid);
-    if (oi.has_manifest()) {
-      // make no references
-      dec_all_refcount_manifest(oi, ctx);
-      oi.manifest.clear();
-      oi.manifest.type = object_manifest_t::TYPE_NONE;
-      oi.clear_flag(object_info_t::FLAG_MANIFEST);
-      ctx->delta_stats.num_objects_manifest--;
-    }
     osd->logger->inc(l_osd_tier_whiteout);
     return 0;
   }
@@ -8868,7 +8860,6 @@ void PrimaryLogPG::finish_ctx(OpContext *ctx, int log_op_type, int result)
   // Drop the reference if deduped chunk is modified
   if (ctx->new_obs.oi.is_dirty() &&
     (ctx->obs->oi.has_manifest() && ctx->obs->oi.manifest.is_chunked()) &&
-    ctx->new_obs.oi.size != 0 && // missing, redirect and delete
     !ctx->cache_operation &&
     log_op_type != pg_log_entry_t::PROMOTE) {
     update_chunk_map_by_dirty(ctx);