]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG::agent_maybe_evict: take write lock, skip on failure
authorSamuel Just <sjust@redhat.com>
Fri, 23 Jan 2015 18:01:39 +0000 (10:01 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 30 Jan 2015 19:33:25 +0000 (11:33 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index f6cb41fc4e2cfa37aae21cc2c107bad265d87a5c..3680b5f813c787eaaddc4e5446c219bf17d0179e 100644 (file)
@@ -12367,9 +12367,15 @@ bool ReplicatedPG::agent_maybe_evict(ObjectContextRef& obc)
       return false;
   }
 
+  if (!obc->get_write(OpRequestRef())) {
+    dout(20) << __func__ << " skip (cannot get lock) " << obc->obs.oi << dendl;
+    return false;
+  }
+
   dout(10) << __func__ << " evicting " << obc->obs.oi << dendl;
   RepGather *repop = simple_repop_create(obc);
   OpContext *ctx = repop->ctx;
+  ctx->lock_to_release = OpContext::W_LOCK;
   ctx->at_version = get_next_version();
   assert(ctx->new_obs.exists);
   int r = _delete_oid(ctx, true);