代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/criu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 539add7149df575d6d8cdce60ad6fb2c2300e27d Mon Sep 17 00:00:00 2001
From: Jingxian He <hejingxian@huawei.com>
Date: Sun, 24 Oct 2021 15:20:27 +0800
Subject: [PATCH 26/72] improve char dev fd check and repair method
Some special char dev cannot work in child processes, we make dump fail
when the special char dev fd is in child processes.
In the char dev repair process, user may need recover fd. We should
make thre repair process running after the char dev fd is reopened as dumped fd.
Conflict:NA
Reference:https://gitee.com/src-openeuler/criu/pulls/21
Signed-off-by: Jingxian He <hejingxian@huawei.com>
---
criu/files-chr.c | 11 +----------
criu/files.c | 12 ++++++++++++
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/criu/files-chr.c b/criu/files-chr.c
index 2eb023e..315e9c6 100644
--- a/criu/files-chr.c
+++ b/criu/files-chr.c
@@ -31,17 +31,8 @@ static int chrfile_open(struct file_desc *d, int *new_fd)
return -1;
}
- if (ci->cfe->repair) {
- ret = ioctl(fd, IOCTL_CMD_REPAIR , ci->cfe->index);
- pr_info("repair ioctl return: %d, index: %d\n", ret, ci->cfe->index);
- if (ret)
- goto err;
- }
-
*new_fd = fd;
- return ret;
-err:
- close(fd);
+
return ret;
}
diff --git a/criu/files.c b/criu/files.c
index e1681a1..7b688f5 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -1231,6 +1231,7 @@ static int open_fd(struct fdinfo_list_entry *fle)
struct file_desc *d = fle->desc;
struct fdinfo_list_entry *flem;
int new_fd = -1, ret;
+ struct chrfile_info *ci;
flem = file_master(d);
if (fle != flem) {
@@ -1258,6 +1259,17 @@ static int open_fd(struct fdinfo_list_entry *fle)
if (ret != -1 && new_fd >= 0) {
if (setup_and_serve_out(fle, new_fd) < 0)
return -1;
+ if (d->ops->type == FD_TYPES__CHR) {
+ ci = container_of(d, struct chrfile_info, d);
+ if (ci->cfe->repair) {
+ ret = ioctl(fle->fe->fd, IOCTL_CMD_REPAIR , ci->cfe->index);
+ pr_info("repair ioctl return: %d, index: %d\n", ret, ci->cfe->index);
+ if (ret) {
+ close(fle->fe->fd);
+ return -1;
+ }
+ }
+ }
}
out:
if (ret == 0)
--
2.34.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。