* [PATCH] tmem: propagate ENOMEM result in error handling
@ 2014-03-29 5:07 Matthew Daley
2014-03-30 21:09 ` Bob Liu
0 siblings, 1 reply; 3+ messages in thread
From: Matthew Daley @ 2014-03-29 5:07 UTC (permalink / raw)
To: xen-devel; +Cc: Matthew Daley, xen-devel
...otherwise if pcd_associate fails due to out-of-memory, the caller of
do_tmem_put will think the call was successful.
While at it, fix up the style issue.
Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
---
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:
--
1.9.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] tmem: propagate ENOMEM result in error handling
2014-03-29 5:07 [PATCH] tmem: propagate ENOMEM result in error handling Matthew Daley
@ 2014-03-30 21:09 ` Bob Liu
2014-04-03 18:04 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 3+ messages in thread
From: Bob Liu @ 2014-03-30 21:09 UTC (permalink / raw)
To: Matthew Daley; +Cc: xen-devel, xen-devel
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 <mattd@bugfuzz.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
> ---
> 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:
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] tmem: propagate ENOMEM result in error handling
2014-03-30 21:09 ` Bob Liu
@ 2014-04-03 18:04 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-04-03 18:04 UTC (permalink / raw)
To: Bob Liu; +Cc: xen-devel, Matthew Daley, xen-devel
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 <mattd@bugfuzz.com>
>
> Reviewed-by: Bob Liu <bob.liu@oracle.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-03 18:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-29 5:07 [PATCH] tmem: propagate ENOMEM result in error handling Matthew Daley
2014-03-30 21:09 ` Bob Liu
2014-04-03 18:04 ` Konrad Rzeszutek Wilk
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.