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

Submitted by Pavel Tikhomirov on April 25, 2016, 2:56 p.m.

Details

Message ID 1461596214-20999-2-git-send-email-ptikhomirov@virtuozzo.com
State Rejected
Series "net/ipv6: c/r dev/default/all conf ops"
Headers show

Commit Message

Pavel Tikhomirov April 25, 2016, 2:56 p.m.
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@virtuozzo.com>
---
 criu/include/sysctl.h | 1 +
 criu/sysctl.c         | 6 ++++++
 2 files changed, 7 insertions(+)

Patch hide | download patch | download mbox

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;