[CRIU] [PATCH 17/19] unix: unlink_sk -- Don't unlink bindmounted sockets

Cyrill Gorcunov gorcunov at gmail.com
Fri Sep 14 17:08:40 MSK 2018


The unlink procedure is rather a cleanup before we
start creating new sockets, but bindmounted sockets
are pre-created early so we should not touch them.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 criu/sk-unix.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index e6a7bb4e0bc9..ef087bada886 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -2114,7 +2114,9 @@ static int unlink_sk(struct unix_sk_info *ui)
 {
 	int ret = 0, cwd_fd = -1, root_fd = -1, ns_fd = -1;
 
-	if (!ui->name || ui->name[0] == '\0' || (ui->ue->uflags & UNIX_UFLAGS__EXTERN))
+	if (!ui->name || ui->name[0] == '\0' ||
+	    (ui->flags & USK_BINDMOUNT) ||
+	    (ui->ue->uflags & UNIX_UFLAGS__EXTERN))
 		return 0;
 
 	if (prep_unix_sk_cwd(ui, &cwd_fd, &root_fd, NULL))
-- 
2.17.1



More information about the CRIU mailing list