[v3,38/55] pid: Add fdstore id for pid_ns descriptor

Submitted by Kirill Tkhai on April 10, 2017, 8:21 a.m.

Details

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

Commit Message

Kirill Tkhai April 10, 2017, 8:21 a.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 87eabfb7b..b126bed2c 100644
--- a/criu/include/namespaces.h
+++ b/criu/include/namespaces.h
@@ -152,6 +152,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 96f989c8e..11b33a0e1 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -310,8 +310,10 @@  struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid,
 			INIT_LIST_HEAD(&nsid->net.ids);
 			INIT_LIST_HEAD(&nsid->net.links);
 			nsid->net.netns = NULL;
-		} else if (nd == &pid_ns_desc)
+		} else if (nd == &pid_ns_desc) {
 			nsid->pid.rb_root = RB_ROOT;
+			nsid->pid.nsfd_id = -1;
+		}
 	}
 
 	return nsid;