[Devel] Re: [PATCH 2/3] c/r: add checkpoint/restore methods to struct proto_ops

Dan Smith danms at us.ibm.com
Mon Aug 17 13:41:47 PDT 2009


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?

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.

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

-- 
Dan Smith
IBM Linux Technology Center
email: danms at us.ibm.com
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list