[CRIU] [PATCH v6 01/13] sysctl: add CTL_FLAGS_HAS to mark successful sysctl_op request

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon Apr 25 07:56:42 PDT 2016


v4: replace separate has pointer to CTL_FLAGS_HAS flag, second part in
patch "net/ipv4: add net_conf_op to reuse for ipv6"
v6: define CTL_FLAGS_HAS

https://jira.sw.ru/browse/PSBM-30942

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 criu/include/sysctl.h | 1 +
 criu/sysctl.c         | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/criu/include/sysctl.h b/criu/include/sysctl.h
index b949a40..3611ef1 100644
--- a/criu/include/sysctl.h
+++ b/criu/include/sysctl.h
@@ -35,5 +35,6 @@ enum {
  * Some entries might be missing mark them as optional.
  */
 #define CTL_FLAGS_OPTIONAL	1
+#define CTL_FLAGS_HAS		2
 
 #endif /* __CR_SYSCTL_H__ */
diff --git a/criu/sysctl.c b/criu/sysctl.c
index 21ae4ce..d8fa04a 100644
--- a/criu/sysctl.c
+++ b/criu/sysctl.c
@@ -261,6 +261,9 @@ static int __userns_sysctl_op(void *arg, int proc_fd, pid_t pid)
 			goto out;
 		}
 
+		/* mark sysctl in question exists */
+		req->flags |= CTL_FLAGS_HAS;
+
 		/* save a pointer to the req, so we don't need to recompute its
 		 * location
 		 */
@@ -371,6 +374,9 @@ static int __nonuserns_sysctl_op(struct sysctl_req *req, size_t nr_req, int op)
 			goto out;
 		}
 
+		/* mark sysctl in question exists */
+		req->flags |= CTL_FLAGS_HAS;
+
 		ret = do_sysctl_op(fd, req, op);
 		if (ret)
 			goto out;
-- 
1.9.3



More information about the CRIU mailing list