From: Jingxian He hejingxian@huawei.com
Add O_REPAIR flag when openning vma fd.
Conflict:NA Reference:https://gitee.com/src-openeuler/criu/pulls/21 Signed-off-by: Jingxian He hejingxian@huawei.com --- criu/files-reg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/criu/files-reg.c b/criu/files-reg.c index e6ae042..6747a3a 100644 --- a/criu/files-reg.c +++ b/criu/files-reg.c @@ -2334,6 +2334,7 @@ void filemap_ctx_fini(void) } }
+#define O_REPAIR 040000000 static int open_filemap(int pid, struct vma_area *vma) { u32 flags; @@ -2346,13 +2347,15 @@ static int open_filemap(int pid, struct vma_area *vma) */
BUG_ON((vma->vmfd == NULL) || !vma->e->has_fdflags); - flags = vma->e->fdflags; + flags = vma->e->fdflags | O_REPAIR;
if (ctx.flags != flags || ctx.desc != vma->vmfd) { if (vma->e->status & VMA_AREA_MEMFD) ret = memfd_open(vma->vmfd, &flags); - else + else { + ret = open_path(vma->vmfd, do_open_reg_noseek_flags, &flags); + } if (ret < 0) return ret;