lxc/0008-hook-pass-correct-mount-dir-as-root-to-hook.patch
lifeng68 641e0c6b48 lxc: fix hook incorrect root dir and refact cgroup
Signed-off-by: lifeng68 <lifeng68@huawei.com>
2020-11-03 10:00:10 +08:00

27 lines
835 B
Diff

From e8d9c6475eb42fdb1775a465353758f2c5418938 Mon Sep 17 00:00:00 2001
From: lifeng68 <lifeng68@huawei.com>
Date: Sat, 31 Oct 2020 17:38:04 +0800
Subject: [PATCH 8/9] hook: pass correct mount dir as root to hook
Signed-off-by: lifeng68 <lifeng68@huawei.com>
---
src/lxc/conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 6a25b96ac..3d8713954 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -4785,7 +4785,7 @@ static int do_run_oci_hooks(const char *name, const char *lxcpath, struct lxc_co
return 0;
}
- rootpath = get_root_path(lc->rootfs.path, lc->rootfs.bdev_type);
+ rootpath = get_root_path(lc->rootfs.path ? lc->rootfs.mount : NULL, lc->rootfs.bdev_type);
if (!rootpath) {
ERROR("Get container %s rootpath failed.", name);
return -1;
--
2.25.1