All of lore.kernel.org
 help / color / mirror / Atom feed
From: Loic Dachary <loic@dachary.org>
To: Sage Weil <sage@inktank.com>
Cc: Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: ObjectContext : check that all references are gone
Date: Tue, 16 Jul 2013 17:28:45 +0200	[thread overview]
Message-ID: <51E566AD.100@dachary.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1307151452110.3857@cobra.newdream.net>

[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]



On 15/07/2013 23:53, Sage Weil wrote:
> On Mon, 15 Jul 2013, Loic Dachary wrote:
>> Hi Sage,
>>
>> You mentionned that there is code somewhere checking the fact that all references to an ObjectContext are gone and that replacing manual reference counting with shared_ptr should preserve this ( i.e. in relation to https://github.com/ceph/ceph/pull/414 "replace ObjectContext pointers with shared_ptr" ). However, I've not been able to find such code. Would you be so kind as to show me where it is ?
>>
>> Cheers
> 
> It's in ReplicatedPG.cc:
> 
> void ReplicatedPG::on_flushed()
> {
>   assert(object_contexts.empty());
> }
> 
> which is called from the Reset state of the PG peering state machine.

It is still here:

https://github.com/dachary/ceph/blob/1a7e390965e6b03f72360f016b2e7d852c455784/src/osd/ReplicatedPG.cc#L6659

and should be ok. Although the de-allocation happens after the last shared_ptr<> goes out of scope instead of being deleted by an explicit call to put_object_context, I believe it happens before on_flushed() is invoked at

https://github.com/dachary/ceph/blob/1a7e390965e6b03f72360f016b2e7d852c455784/src/osd/PG.cc#L5225

I can't imagine a case where it would assert with the proposed patch. 

Cheers
> 
> sage
> 

-- 
Loïc Dachary, Artisan Logiciel Libre
All that is necessary for the triumph of evil is that good people do nothing.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

      reply	other threads:[~2013-07-16 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15 19:25 ObjectContext : check that all references are gone Loic Dachary
2013-07-15 21:53 ` Sage Weil
2013-07-16 15:28   ` Loic Dachary [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E566AD.100@dachary.org \
    --to=loic@dachary.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.