From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] tmem: propagate ENOMEM result in error handling Date: Thu, 3 Apr 2014 14:04:43 -0400 Message-ID: <20140403180441.GA24597@andromeda.dapyr.net> References: <1396069649-5773-1-git-send-email-mattd@bugfuzz.com> <5338880D.50709@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WVm0W-000469-9D for xen-devel@lists.xenproject.org; Thu, 03 Apr 2014 18:04:56 +0000 Content-Disposition: inline In-Reply-To: <5338880D.50709@oracle.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: Bob Liu Cc: xen-devel@lists.xenproject.org, Matthew Daley , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, Mar 31, 2014 at 05:09:33AM +0800, Bob Liu wrote: > > On 03/29/2014 01:07 PM, Matthew Daley wrote: > > ...otherwise if pcd_associate fails due to out-of-memory, the caller of > > do_tmem_put will think the call was successful. > > > > Good catch! Thanks a lot! > > > While at it, fix up the style issue. > > > > Signed-off-by: Matthew Daley > > Reviewed-by: Bob Liu Acked-by: Konrad Rzeszutek Wilk Thanks! > > > --- > > xen/common/tmem.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/xen/common/tmem.c b/xen/common/tmem.c > > index 02e7e2e..9cebe11 100644 > > --- a/xen/common/tmem.c > > +++ b/xen/common/tmem.c > > @@ -1646,8 +1646,11 @@ copy_uncompressed: > > > > if ( tmem_dedup_enabled() && !is_persistent(pool) ) > > { > > - if ( pcd_associate(pgp,NULL,0) == -ENOMEM ) > > + if ( pcd_associate(pgp, NULL, 0) == -ENOMEM ) > > + { > > + ret = -ENOMEM; > > goto del_pgp_from_obj; > > + } > > } > > > > insert_page: > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel