From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Ryan Subject: Re: RBD Async request: When / How are the call back called ? Date: Thu, 30 Aug 2012 07:52:10 -0700 Message-ID: <20120830145209.GE19573@splice> References: <503E47C6.2040200@inktank.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:52816 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752780Ab2H3OwQ (ORCPT ); Thu, 30 Aug 2012 10:52:16 -0400 Received: by pbbrr13 with SMTP id rr13so3258417pbb.19 for ; Thu, 30 Aug 2012 07:52:16 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: ceph-devel-owner@vger.kernel.org List-ID: To: Sylvain Munaut Cc: ceph-devel@vger.kernel.org On Thu, Aug 30, 2012 at 02:16:36PM +0200, Sylvain Munaut wrote: > One more question: When I have async read pending, I would have > expected rbd_flush and/or rbd_close to wait for them to finish but > they dont. Is there a way to wait for all operation to be complete ? > Because if I shutdown everything before they are, the application > hangs ... There's nothing in the API for that. You have to manually iterate over all your completion contexts calling wait_for_safe_and_cb() on each. Note: even if you don't have a callback, you should use the _cb() version. I just fixed a use-after-free bug the was caused by this.