Skip to content
Commit 019ebec0 authored by Andrey Vagin's avatar Andrey Vagin Committed by Andrei Vagin
Browse files

unix: restore sockets on correct mount points



Currently we restore all sockets in the root mount namespace, because we
were not able to get any information about a mount point where a socket
is bound. It is obviously incorrect in some cases.

In 4.10 kernel, we added the SIOCUNIXFILE ioctl for unix sockets.  This
ioctl opens a file to which a socket is bound and returns a file
descriptor.

This new ioctl allows us to get mnt_id by reading fdinfo, and mnt_id
is enough to find a proper mount point and a mount namespace.

The logic of this patch is straight forward. On dump, we save mnt_id for
sockets, on restore we find a mount namespace by mnt_id and restore this
socket in its mount namespace.

Acked-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: default avatarAndrei Vagin <avagin@virtuozzo.com>
parent 6d785e6c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment