Commit 640e5c46 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

dump: Call fsync only if needed

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent d4870632
......@@ -147,12 +147,6 @@ int prep_cr_fdset_for_dump(struct cr_fdset *cr_fdset,
magic = cr_fdset->desc[i].tmpl->magic;
write_ptr_safe(cr_fdset->desc[i].fd, &magic, err);
/*
* Make sure it's on disk since we might
* need to re-open files in parasite.
*/
fsync(cr_fdset->desc[i].fd);
}
ret = 0;
err:
......
......@@ -270,6 +270,12 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a
goto chmod_err;
}
/*
* Make sure the data is on disk since we will re-open
* it in another process.
*/
fsync(cr_fdset->desc[fd_type].fd);
jerr(ptrace(PTRACE_GETREGS, ctl->pid, NULL, &regs_orig), err);
parasite_arg.command = PARASITE_CMD_DUMPPAGES;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment