[CRIU] [PATCH 15/28] dump: remove dumping on file name into
fdinfo_entry for regular files
Kinsbursky Stanislav
skinsbursky at openvz.org
Thu Mar 22 13:59:11 EDT 2012
From: Stanislav Kinsbursky <skinsbursky at openvz.org>
Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
cr-dump.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
-------------- next part --------------
diff --git a/cr-dump.c b/cr-dump.c
index 5c2c84f..6e6a5ec 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -112,11 +112,6 @@ static int dump_one_reg_file(struct file_entry *p, pid_t pid,
if (do_close_lfd)
close(lfd);
- e.len = len;
- e.flags = p->flags;
- e.pos = p->pos;
- e.addr = target_fd;
-
fde->type = p->type;
fde->fd = (u32)target_fd;
fde->id = FD_ID_INVALID;
@@ -147,6 +142,11 @@ static int dump_one_reg_file(struct file_entry *p, pid_t pid,
if (write_img_buf(cr_fdset->fds[CR_FD_REG_FILES], big_buffer, len))
return -1;
}
+ } else {
+ e.len = len;
+ e.flags = p->flags;
+ e.pos = p->pos;
+ e.addr = target_fd;
}
pr_info("fdinfo: type: %2x len: %2x flags: %4x pos: %8lx addr: %16lx\n",
@@ -154,8 +154,9 @@ static int dump_one_reg_file(struct file_entry *p, pid_t pid,
if (write_img(cr_fdset->fds[CR_FD_FDINFO], &e))
return -1;
- if (write_img_buf(cr_fdset->fds[CR_FD_FDINFO], big_buffer, e.len))
- return -1;
+ if (unlikely(fd_is_special(fde)))
+ if (write_img_buf(cr_fdset->fds[CR_FD_FDINFO], big_buffer, e.len))
+ return -1;
return 0;
}
More information about the CRIU
mailing list