19 Star 0 Fork 35

openEuler-RISC-V/criu

forked from src-openEuler/criu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0042-reg-file-fix-dump-fail-problem-with-null-seek-op.patch 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
river 提交于 2022-04-13 15:05 . criu: backport kinds of features/bugfix
From 06a0277c2aab1442c724217957fd5f915ace2753 Mon Sep 17 00:00:00 2001
From: Zhuling <zhuling8@huawei.com>
Date: Thu, 22 Jul 2021 10:15:15 +0800
Subject: [PATCH 42/72] reg-file: fix dump fail problem with null seek op
Some customizing `struct file_operations` implementation has
no `llseek`, therefore ignore the no-implementation errno.
Fix file dumping fail problem when the file seek op is null.
Signed-off-by: Jingxian He <hejingxian@huawei.com>
Signed-off-by: fu.lin <fulin10@huawei.com>
---
criu/files-reg.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/criu/files-reg.c b/criu/files-reg.c
index 1a3b836..6dc8745 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -2176,9 +2176,18 @@ static int do_open_reg(int ns_root_fd, struct reg_file_info *rfi, void *arg)
*/
if (!(rfi->rfe->flags & O_PATH)) {
if (rfi->rfe->pos != -1ULL && lseek(fd, rfi->rfe->pos, SEEK_SET) < 0) {
- pr_perror("Can't restore file pos");
- close(fd);
- return -1;
+ /*
+ * Some customizing `struct file_operations`
+ * implementation has no `llseek`, therefore
+ * ignore the no-implementation errno.
+ */
+ if (errno == ESPIPE) {
+ pr_warn("No ability to restore file ops\n");
+ } else {
+ pr_perror("Can't restore file pos");
+ close(fd);
+ return -1;
+ }
}
}
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-risc-v/criu.git
git@gitee.com:openeuler-risc-v/criu.git
openeuler-risc-v
criu
criu
master

搜索帮助