1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

oomd: wrap paths in oomd_insert_cgroup_context with empty_to_root

This commit is contained in:
Anita Zhang 2021-03-08 10:21:37 -08:00 committed by Zbigniew Jędrzejewski-Szmek
parent 45da27fa05
commit 50c0578b61
2 changed files with 5 additions and 1 deletions

View File

@ -112,7 +112,7 @@ static int process_managed_oom_reply(
continue;
}
ret = oomd_insert_cgroup_context(NULL, monitor_hm, empty_to_root(reply.path));
ret = oomd_insert_cgroup_context(NULL, monitor_hm, reply.path);
if (ret == -ENOMEM) {
r = ret;
goto finish;

View File

@ -390,10 +390,14 @@ int oomd_insert_cgroup_context(Hashmap *old_h, Hashmap *new_h, const char *path)
assert(new_h);
assert(path);
path = empty_to_root(path);
r = oomd_cgroup_context_acquire(path, &curr_ctx);
if (r < 0)
return log_debug_errno(r, "Failed to get OomdCGroupContext for %s: %m", path);
assert_se(streq(path, curr_ctx->path));
old_ctx = hashmap_get(old_h, path);
if (old_ctx) {
curr_ctx->last_pgscan = old_ctx->pgscan;