iSulad/0081-fix-lose-ipc-shm-mount-point.patch
openeuler-sync-bot fcbe0495eb !587 [sync] PR-586: upgrade from upstream
* upgrade from upstream
2023-07-19 09:11:19 +00:00

46 lines
1.3 KiB
Diff

From 9ebe9443ec6c2f6891beb508df81aa9d42685a4e Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Mon, 5 Jun 2023 17:08:20 +0800
Subject: [PATCH 02/15] fix lose ipc shm mount point
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
src/daemon/modules/spec/specs_mount.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/daemon/modules/spec/specs_mount.c b/src/daemon/modules/spec/specs_mount.c
index c39fce36..c312e08e 100644
--- a/src/daemon/modules/spec/specs_mount.c
+++ b/src/daemon/modules/spec/specs_mount.c
@@ -2761,21 +2761,21 @@ int setup_ipc_dirs(host_config *host_spec, container_config_v2_common_config *v2
ret = chown_for_shm(spath, host_spec->user_remap);
if (ret != 0) {
- ret = -1;
- goto out;
+ goto err_out;
}
#ifdef ENABLE_USERNS_REMAP
if (change_shm_parent_dirs_owner_for_userns_remap(host_spec, spath) != 0) {
ERROR("Failed to change shm directory owner for user remap.");
- ret = -1;
- goto out;
+ goto err_out;
}
#endif
-out:
+ return 0;
+
+err_out:
(void)umount(spath);
- return ret;
+ return -1;
}
static bool add_shm_mount(defs_mount ***all_mounts, size_t *all_mounts_len, const char *shm_path)
--
2.25.1