[CRIU] Re: [PATCH 3/4] sockets: Restore unbound inet sockets
Pavel Emelyanov
xemul at parallels.com
Fri May 25 02:42:18 EDT 2012
On 05/23/2012 07:35 PM, Cyrill Gorcunov wrote:
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
> include/sockets.h | 2 +
> sk-inet.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++++-----
> sockets.c | 10 +++-
> 3 files changed, 114 insertions(+), 14 deletions(-)
>
> @@ -128,8 +128,12 @@ int dump_socket(struct fd_parms *p, int lfd, const struct cr_fdset *cr_fdset)
>
> sk = lookup_socket(p->stat.st_ino);
I'd expect this lookup being removed, since you call it _again_ inside
dump_one_inet/_unix.
If you need the family for switch you can get one via getsockopt.
> if (!sk) {
> - pr_err("Uncollected socket 0x%8x\n", (int)p->stat.st_ino);
> - return -1;
> + /*
> + * If socket is unconnected inet one, then
> + * it might be not reported via netlink,
> + * so try to dump it in a different way.
> + */
> + return dump_one_inet(p, lfd, cr_fdset);
> }
>
> switch (sk->family) {
More information about the CRIU
mailing list