Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
To: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH 2/3] c/r: add checkpoint/restore methods to struct proto_ops
Date: Mon, 17 Aug 2009 17:07:13 -0400	[thread overview]
Message-ID: <4A89C681.7030307@librato.com> (raw)
In-Reply-To: <87r5va5g1g.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>



Dan Smith wrote:
> OL> -	if ((h->sock.type != SOCK_DGRAM) && (h->sock.type != SOCK_STREAM)) {
> OL> -		ckpt_debug("Socket type %i not supported", h->sock.type);
> OL> +	if (h->sock.type & ~SOCK_TYPE_MASK)
> OL>  		return ERR_PTR(-EINVAL);
> OL> -	}
> 
> The idea here was to prevent a rewritten checkpoint stream from
> causing us to call sock_create() with a type that we don't support.
> Checking the mask may be functionally equivalent right now, but may
> open the door for an interesting failure later, no?

I figured that if we called a sock_create() for a type that isn't
supported by checkpoint/restart, we will catch it down the code by
testing sock->ops->restore. That way, I don't need to "teach"
sock_file_restore() about socket types and protocols.

> 
> OL>  static const struct proto_ops unix_seqpacket_ops = {
> OL> @@ -565,6 +569,8 @@ static const struct proto_ops unix_seqpacket_ops = {
> OL>  	.recvmsg =	unix_dgram_recvmsg,
> OL>  	.mmap =		sock_no_mmap,
> OL>  	.sendpage =	sock_no_sendpage,
> OL> +	.checkpoint =	sock_unix_checkpoint,
> OL> +	.restore =	sock_unix_restore,
> OL>  };
> 
> Have you tested SEQPACKET?  I haven't.

Hehe ... I guess I'm too eager :)

Do you see any reason why it should work ?  The only difference (for
afunix) between dgram and seqpacket is the requirement that the socket
be connected - see unix_seqpacket_sendmsg().

> 
> Other than that, it looks fine to me and fails the same set of tests
> that the current tree does.
> 

Thanks,

Oren.

  parent reply	other threads:[~2009-08-17 21:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 20:12 c/r: some cleanup for sockets Oren Laadan
     [not found] ` <1250539931-12951-1-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-08-17 20:12   ` [PATCH 1/3] c/r: cleanup sock_file_restore()/sock_file_checkpoint() Oren Laadan
     [not found]     ` <1250539931-12951-2-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-08-17 20:57       ` Dan Smith
2009-08-17 20:12   ` [PATCH 2/3] c/r: add checkpoint/restore methods to struct proto_ops Oren Laadan
     [not found]     ` <1250539931-12951-3-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-08-17 20:41       ` Dan Smith
     [not found]         ` <87r5va5g1g.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-08-17 21:07           ` Oren Laadan [this message]
2009-08-17 21:21             ` Dan Smith
     [not found]               ` <874os65e6q.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-08-17 21:41                 ` Oren Laadan
2009-08-17 20:12   ` [PATCH 3/3] c/r: cleanup - follow naming conventions Oren Laadan
     [not found]     ` <1250539931-12951-4-git-send-email-orenl-RdfvBDnrOixBDgjK7y7TUQ@public.gmane.org>
2009-08-17 20:48       ` Dan Smith

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=4A89C681.7030307@librato.com \
    --to=orenl-rdfvbdnroixbdgjk7y7tuq@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=danms-r/Jw6+rmf7HQT0dZR+AlfA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox