All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH 1/1] cr: fix ckpt_obj_fetch return values (v2)
Date: Thu, 14 May 2009 09:14:49 -0500	[thread overview]
Message-ID: <20090514141449.GA4972@us.ibm.com> (raw)
In-Reply-To: <4A0BF2AD.8030304-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org):
> > @@ -1246,9 +1244,7 @@ int restore_mm_obj(struct ckpt_ctx *ctx, int mm_objref)
> >  	int ret;
> >  
> >  	mm = ckpt_obj_fetch(ctx, mm_objref, CKPT_OBJ_MM);
> > -	if (!mm)
> > -		return -EINVAL;
> > -	else if (IS_ERR(mm))
> > +	if (IS_ERR(mm))
> >  		return -EINVAL;
> 			^^^^^^
> should be:		PTR_ERR(mm);

Oops, right.

> > diff --git a/fs/pipe.c b/fs/pipe.c
> > index ab2de3c..b284dcb 100644
> > --- a/fs/pipe.c
> > +++ b/fs/pipe.c
> > @@ -982,14 +982,12 @@ struct file *pipe_file_restore(struct ckpt_ctx *ctx, struct ckpt_hdr_file *ptr)
> >  		return ERR_PTR(-EINVAL);
> >  
> >  	file = ckpt_obj_fetch(ctx, h->pipe_objref, CKPT_OBJ_FILE);
> > -	if (IS_ERR(file))
> > -		return file;
> >  	/*
> > -	 * If ckpt_obj_fetch() returned NULL, then this is the first
> > +	 * If ckpt_obj_fetch() returned -EINVAL, then this is the first
> >  	 * time we see this pipe so need to restore the contents.
> >  	 * Otherwise, use the file pointer skip forward.
> >  	 */
> > -	if (!file) {
> > +	if (PTR_ERR(file) == -EINVAL) {
> 
> ckpt_obj_fetch() will also fail with -EINVAL if the type of the object
> found doesn't match the type that was requested. Hence why originally
> the two return values. So I changed that latter to report -ENOMSG (that
> is:  /* No message of desired type */)

Hmm, yes I was thinking of the checkpoint case where mismatched types
would be strictly an objhash bug.  You're right, this case can just
be a bad checkpoint image!

thanks,
-serge

  parent reply	other threads:[~2009-05-14 14:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 21:06 [PATCH 1/1] cr: fix ckpt_obj_fetch return values (v2) Serge E. Hallyn
     [not found] ` <20090513210641.GA22784-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-05-14 10:30   ` Oren Laadan
     [not found]     ` <4A0BF2AD.8030304-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-05-14 14:14       ` Serge E. Hallyn [this message]
     [not found]         ` <20090514141449.GA4972-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-05-14 15:34           ` Oren Laadan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090514141449.GA4972@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.