Skip to contentSkip to conversation

Invert the NETNS checkpoint flag

PATCH In review Dan Smith 3 participants 3 messages Apr 2, 2010 – Apr 24, 2010 1 message not in the archive

lore
Share & tools
lore

Dan Smith

author
#0 lore raw

PATCH 1/1 Invert the NETNS checkpoint flag

Change CHECKPOINT_NONETNS to CHECKPOINT_NETNS. This makes it the default to ignore network namespaces and devices, unless specifically asked for by the caller.

---
 include/linux/checkpoint.h |    4 ++--
 kernel/nsproxy.c           |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
include/linux/checkpoint.h +2 -2
index 6da0a2e..96693e2 100644
@@ -14,7 +14,7 @@
 
 /* checkpoint user flags */
 #define CHECKPOINT_SUBTREE	0x1
-#define CHECKPOINT_NONETNS	0x2
+#define CHECKPOINT_NETNS	0x2
 
 /* restart user flags */
 #define RESTART_TASKSELF	0x1
@@ -59,7 +59,7 @@ extern long do_sys_restart(pid_t pid, int fd,
 /* ckpt_ctx: uflags */
 #define CHECKPOINT_USER_FLAGS \
 	(CHECKPOINT_SUBTREE | \
-	 CHECKPOINT_NONETNS)
+	 CHECKPOINT_NETNS)
 
 #define RESTART_USER_FLAGS  \
 	(RESTART_TASKSELF | \
kernel/nsproxy.c +2 -2
index c19f5fa..041fb09 100644
@@ -249,7 +249,7 @@ int ckpt_collect_ns(struct ckpt_ctx *ctx, struct task_struct *t)
 	if (ret < 0)
 		goto out;
 #ifdef CONFIG_NETNS_CHECKPOINT
-	if (!(ctx->uflags & CHECKPOINT_NONETNS))
+	if (ctx->uflags & CHECKPOINT_NETNS)
 		ret = ckpt_obj_collect(ctx, nsproxy->net_ns, CKPT_OBJ_NET_NS);
 	if (ret < 0)
 		goto out;
@@ -295,7 +295,7 @@ static int do_checkpoint_ns(struct ckpt_ctx *ctx, struct nsproxy *nsproxy)
 		goto out;
 	h->ipc_objref = ret;
 #ifdef CONFIG_NETNS_CHECKPOINT
-	if (!(ctx->uflags & CHECKPOINT_NONETNS))
+	if (ctx->uflags & CHECKPOINT_NETNS)
 		ret = checkpoint_obj(ctx, nsproxy->net_ns, CKPT_OBJ_NET_NS);
 	else
 		ret = 0;
Signature · 1 line
1.6.2.5

A message that is not in the archive (sent off-list or not yet received): 1270215265-29081-1-git-send-email-danms-r/[email protected]

#2 lore raw
Quoted 5 lines · Dan Smith

Change CHECKPOINT_NONETNS to CHECKPOINT_NETNS. This makes it the default to ignore network namespaces and devices, unless specifically asked for by the caller.

Quoted 56 lines
---
 include/linux/checkpoint.h |    4 ++--
 kernel/nsproxy.c           |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
include/linux/checkpoint.h +2 -2
index 6da0a2e..96693e2 100644
@@ -14,7 +14,7 @@
 
 /* checkpoint user flags */
 #define CHECKPOINT_SUBTREE	0x1
-#define CHECKPOINT_NONETNS	0x2
+#define CHECKPOINT_NETNS	0x2
 
 /* restart user flags */
 #define RESTART_TASKSELF	0x1
@@ -59,7 +59,7 @@ extern long do_sys_restart(pid_t pid, int fd,
 /* ckpt_ctx: uflags */
 #define CHECKPOINT_USER_FLAGS \
 	(CHECKPOINT_SUBTREE | \
-	 CHECKPOINT_NONETNS)
+	 CHECKPOINT_NETNS)
 
 #define RESTART_USER_FLAGS  \
 	(RESTART_TASKSELF | \
kernel/nsproxy.c +2 -2
index c19f5fa..041fb09 100644
@@ -249,7 +249,7 @@ int ckpt_collect_ns(struct ckpt_ctx *ctx, struct task_struct *t)
 	if (ret < 0)
 		goto out;
 #ifdef CONFIG_NETNS_CHECKPOINT
-	if (!(ctx->uflags & CHECKPOINT_NONETNS))
+	if (ctx->uflags & CHECKPOINT_NETNS)
 		ret = ckpt_obj_collect(ctx, nsproxy->net_ns, CKPT_OBJ_NET_NS);
 	if (ret < 0)
 		goto out;
@@ -295,7 +295,7 @@ static int do_checkpoint_ns(struct ckpt_ctx *ctx, struct nsproxy *nsproxy)
 		goto out;
 	h->ipc_objref = ret;
 #ifdef CONFIG_NETNS_CHECKPOINT
-	if (!(ctx->uflags & CHECKPOINT_NONETNS))
+	if (ctx->uflags & CHECKPOINT_NETNS)
 		ret = checkpoint_obj(ctx, nsproxy->net_ns, CKPT_OBJ_NET_NS);
 	else
 		ret = 0;
Signature · 6 lines
1.6.2.5

_______________________________________________
Containers mailing list
Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers
#3 lore raw
In reply to a message not in the archive

Applied for ckpt-v21-rc3.

Quoted 54 lines · Dan Smith

Change CHECKPOINT_NONETNS to CHECKPOINT_NETNS. This makes it the default to ignore network namespaces and devices, unless specifically asked for by the caller.

---
 include/linux/checkpoint.h |    4 ++--
 kernel/nsproxy.c           |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
include/linux/checkpoint.h +2 -2
index 6da0a2e..96693e2 100644
@@ -14,7 +14,7 @@
 
 /* checkpoint user flags */
 #define CHECKPOINT_SUBTREE	0x1
-#define CHECKPOINT_NONETNS	0x2
+#define CHECKPOINT_NETNS	0x2
 
 /* restart user flags */
 #define RESTART_TASKSELF	0x1
@@ -59,7 +59,7 @@ extern long do_sys_restart(pid_t pid, int fd,
 /* ckpt_ctx: uflags */
 #define CHECKPOINT_USER_FLAGS \
 	(CHECKPOINT_SUBTREE | \
-	 CHECKPOINT_NONETNS)
+	 CHECKPOINT_NETNS)
 
 #define RESTART_USER_FLAGS  \
 	(RESTART_TASKSELF | \
kernel/nsproxy.c +2 -2
index c19f5fa..041fb09 100644
@@ -249,7 +249,7 @@ int ckpt_collect_ns(struct ckpt_ctx *ctx, struct task_struct *t)
 	if (ret < 0)
 		goto out;
 #ifdef CONFIG_NETNS_CHECKPOINT
-	if (!(ctx->uflags & CHECKPOINT_NONETNS))
+	if (ctx->uflags & CHECKPOINT_NETNS)
 		ret = ckpt_obj_collect(ctx, nsproxy->net_ns, CKPT_OBJ_NET_NS);
 	if (ret < 0)
 		goto out;
@@ -295,7 +295,7 @@ static int do_checkpoint_ns(struct ckpt_ctx *ctx, struct nsproxy *nsproxy)
 		goto out;
 	h->ipc_objref = ret;
 #ifdef CONFIG_NETNS_CHECKPOINT
-	if (!(ctx->uflags & CHECKPOINT_NONETNS))
+	if (ctx->uflags & CHECKPOINT_NETNS)
 		ret = checkpoint_obj(ctx, nsproxy->net_ns, CKPT_OBJ_NET_NS);
 	else
 		ret = 0;