From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 16/28] libxl: ao: Provide manip_refcnt Date: Wed, 15 Apr 2015 16:13:00 +0100 Message-ID: <1429110780.15516.326.camel@citrix.com> References: <1427828465-25710-1-git-send-email-ian.jackson@eu.citrix.com> <1427828465-25710-17-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427828465-25710-17-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Tue, 2015-03-31 at 20:00 +0100, Ian Jackson wrote: > Previously we used in_initiator to stop the ao being freed while we > were still in the initiator function (which would result in the > initiator's call to lixl__ao_inprogress accessing the ao after it had > been freed). > > We are going to introduce a new libxl entrypoint which finds, and > operates on, ongoing aos. This function needs the same protection, > and might even end up running on the same ao multiple times > concurrently. > > So do this with reference counting instead, with a new variable > ao->manip_refcnt. > > We keep ao->in_initiator because that allows us to keep some useful > asserts about the sequencing of libxl__ao_inprogress, etc. > > Signed-off-by: Ian Jackson Acked-by: Ian Campbell