[Devel] Re: [PATCH 1/3] Make sockets proper objhash objects and use checkpoint_obj() on them (v2)

Serge E. Hallyn serue at us.ibm.com
Wed Sep 2 22:40:58 PDT 2009


Quoting Dan Smith (danms at us.ibm.com):
> +static int do_sock_checkpoint(struct ckpt_ctx *ctx, struct sock *sk)
> +{
> +	struct socket *sock;
> +	int ret;
> +
> +	if (sk->sk_socket)
> +		return __do_sock_checkpoint(ctx, sk);
> +
> +	/* Temporarily adopt this orphan socket */
> +	ret = sock_create(sk->sk_family, sk->sk_type, 0, &sock);
> +	if (ret < 0)
> +		return ret;
> +	sock_graft(sk, sock);
> +
> +	ret = __do_sock_checkpoint(ctx, sk);

I'm sure I sound like an idiot, but... at restore, a socket will
be created for sk now.  Is that a problem?  I don't see where
sk_free() will cause that sock to be freed, and you are not
attaching it do a file whose close would cause it to be released...

-serge
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list