From: Ian Jackson Subject: Re: [PATCH] oxenstored: Quota.merge: don't assume domain already exists Date: Wed, 11 Nov 2015 15:24:56 +0000 Message-ID: <22083.24008.710618.542509@mariner.uk.xensource.com> References: <1447240913-22973-1-git-send-email-jonathan.davies@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1447240913-22973-1-git-send-email-jonathan.davies@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: Jonathan Davies Cc: David Scott , Wei Liu , Ian Campbell , Stefano Stabellini , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Jonathan Davies writes ("[PATCH] oxenstored: Quota.merge: don't assume domain already exists"): > In Quota.merge, we merge two quota hashtables, orig_quota and mod_quota, putting > the results into dest_quota. These hashtables map domids to the number of > entries currently owned by that domain. > > When mod_quota contains an entry for a domid that was not present in orig_quota > (or dest_quota), the call to get_entry caused Quota.merge to raise a Not_found > exception. This propagates back to the client as an ENOENT error, which is not > an appropriate return value from some operations, such as transaction_end. > > This situation can arise when a transaction that introduces a domain (hence > calling Quota.add_entry) needs to be coalesced due to concurrent xenstore > activity. > > This patch handles the merge in the case where mod_quota contains an entry not > present in orig_quota (or in dest_quota) by treating that hashtable as having > existing value 0. > > Signed-off-by: Jonathan Davies The ocaml looks vaguely plausible. I speak enough ocaml to see that this looks (out of context and with my half-remembered knowledge of oxenstored innards) like it does what you say. Acked-by: Ian Jackson Thanks, Ian.