mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
dump: Call fsync only if needed
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
@@ -147,12 +147,6 @@ int prep_cr_fdset_for_dump(struct cr_fdset *cr_fdset,
|
|||||||
|
|
||||||
magic = cr_fdset->desc[i].tmpl->magic;
|
magic = cr_fdset->desc[i].tmpl->magic;
|
||||||
write_ptr_safe(cr_fdset->desc[i].fd, &magic, err);
|
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;
|
ret = 0;
|
||||||
err:
|
err:
|
||||||
|
@@ -270,6 +270,12 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a
|
|||||||
goto chmod_err;
|
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, ®s_orig), err);
|
jerr(ptrace(PTRACE_GETREGS, ctl->pid, NULL, ®s_orig), err);
|
||||||
|
|
||||||
parasite_arg.command = PARASITE_CMD_DUMPPAGES;
|
parasite_arg.command = PARASITE_CMD_DUMPPAGES;
|
||||||
|
Reference in New Issue
Block a user