The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at 
https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.10.12
------>
commit ef5480be4d18b212b6c88f44aae3b60a0d80a0d6
Author: Valeriy Vdovin <valeriy.vdo...@virtuozzo.com>
Date:   Wed Oct 20 11:43:54 2021 +0300

    cgroup/cfs: added 'activate' option to cgroup_add_file
    
    In kernfs files get created in 'deactivated' state, which means they are
    not visible. Add option to activate the file after creation immediately
    making it visible in the parent directory. Will be used when adding
    release agent files to ve cgroup roots.
    
    Signed-off-by: Valeriy Vdovin <valeriy.vdo...@virtuozzo.com>
    
    vz9 change: cleanup commit message
    
    https://jira.sw.ru/browse/PSBM-134002
    (cherry picked from vz8 commit 53fae899bb7e04cbe8ba229c4e2134c8688e65bf)
    Signed-off-by: Pavel Tikhomirov <ptikhomi...@virtuozzo.com>
    
    Reviewed-by: Alexander Mikhalitsyn <alexander.mikhalit...@virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktk...@virtuozzo.com>
---
 kernel/cgroup/cgroup.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index c64797ecd49a..ff9f5b9dc219 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -4188,7 +4188,7 @@ static void cgroup_file_notify_timer(struct timer_list 
*timer)
 }
 
 static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup 
*cgrp,
-                          struct cftype *cft)
+                          struct cftype *cft, bool activate)
 {
        char name[CGROUP_FILE_NAME_MAX];
        struct kernfs_node *kn;
@@ -4230,6 +4230,8 @@ static int cgroup_add_file(struct cgroup_subsys_state 
*css, struct cgroup *cgrp,
                if (IS_ERR(kn_link))
                        return PTR_ERR(kn_link);
        }
+       if (activate)
+               kernfs_activate(kn);
 
        return 0;
 }
@@ -4269,7 +4271,7 @@ static int cgroup_addrm_files(struct cgroup_subsys_state 
*css,
                if ((cft->flags & CFTYPE_DEBUG) && !cgroup_debug)
                        continue;
                if (is_add) {
-                       ret = cgroup_add_file(css, cgrp, cft);
+                       ret = cgroup_add_file(css, cgrp, cft, false);
                        if (ret) {
                                pr_warn("%s: failed to add %s, err=%d\n",
                                        __func__, cft->name, ret);
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to