[CRIU] [PATCH] restore: Report error number if PR_SET_MM failed

Cyrill Gorcunov gorcunov at gmail.com
Wed Dec 7 00:33:45 PST 2016


On Wed, Dec 07, 2016 at 12:31:23AM -0800, Andrey Vagin wrote:
> On Tue, Dec 06, 2016 at 10:25:21PM +0300, Cyrill Gorcunov wrote:
> > Reported-by: Andrei Vagin <avagin at virtuozzo.com>
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> >  criu/pie/restorer.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
> > index c837656379d3..764a5e6995b6 100644
> > --- a/criu/pie/restorer.c
> > +++ b/criu/pie/restorer.c
> > @@ -1378,8 +1378,11 @@ skip_vdso:
> >  		 * new ones from image file.
> >  		 */
> >  		ret |= restore_self_exe_late(args);
> > -	} else
> > +	} else {
> > +		if (ret)
> > +			pr_err("sys_prctl(PR_SET_MM, PR_SET_MM_MAP) failed with %d\n", (int)ret);
> >  		sys_close(args->fd_exe_link);
> > +	}
> >  
> >  	if (ret)
> 
> I think it will be better to print an error here. What do you think?

Well, at this moment ret might carry error from prctl_safe, which already has
error printed, so we need error print for plain sys_prctl.


More information about the CRIU mailing list