[RESEND,v1,41/55] pid: Add fdstore id for pid_ns descriptor

Submitted by Kirill Tkhai on March 24, 2017, 3:15 p.m.

Details

Message ID 149036852839.23093.16222492323278581149.stgit@localhost.localdomain
State New
Series "Nested pid namespaces support"
Headers show

Commit Message

Kirill Tkhai March 24, 2017, 3:15 p.m.
Field to keep fdstore id of open pid_ns descriptor.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 criu/include/namespaces.h |    1 +
 criu/namespaces.c         |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/include/namespaces.h b/criu/include/namespaces.h
index c3bc644e..65f471ab 100644
--- a/criu/include/namespaces.h
+++ b/criu/include/namespaces.h
@@ -122,6 +122,7 @@  struct ns_id {
 		} user;
 		struct {
 			struct rb_root rb_root;
+			int nsfd_id;
 		} pid;
 	};
 };
diff --git a/criu/namespaces.c b/criu/namespaces.c
index 1a5eb836..9ed5ff7d 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -309,8 +309,10 @@  struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid,
 		nsid->ns_populated = false;
 		INIT_LIST_HEAD(&nsid->children);
 		INIT_LIST_HEAD(&nsid->siblings);
-		if (nd == &pid_ns_desc)
+		if (nd == &pid_ns_desc) {
 			nsid->pid.rb_root = RB_ROOT;
+			nsid->pid.nsfd_id = -1;
+		}
 	}
 
 	return nsid;