mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-06 01:05:29 +00:00
shm: Do not dump sysvshm twice
The contents of sysvshm areas is sometimes dumped twice. First time it goes via cr_dump_shmem(), since each attachment of the segment is noted by the add_shmem_area() and thus gets into the list scanned by the former call(). Second time it is dumped by dump_ipc_shm_pages(). Another thing is that in the 1st dump memory gets into the standard pagemap/pages image pair, while in the 2nd time it's all written as plain byte array into ipcns-shm.img. At restore contents is read from the ipcns-shm.img (2nd). While the first way is preferred, let's (temporarily) eliminate it. Historically these segments were dumped and restored the 2nd way. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
@@ -585,6 +585,9 @@ int add_shmem_area(pid_t pid, VmaEntry *vma, u64 *map)
|
|||||||
struct shmem_info *si;
|
struct shmem_info *si;
|
||||||
unsigned long size = vma->pgoff + (vma->end - vma->start);
|
unsigned long size = vma->pgoff + (vma->end - vma->start);
|
||||||
|
|
||||||
|
if (vma_entry_is(vma, VMA_AREA_SYSVIPC))
|
||||||
|
pid = SYSVIPC_SHMEM_PID;
|
||||||
|
|
||||||
si = shmem_find(vma->shmid);
|
si = shmem_find(vma->shmid);
|
||||||
if (si) {
|
if (si) {
|
||||||
if (si->size < size) {
|
if (si->size < size) {
|
||||||
@@ -745,6 +748,8 @@ int cr_dump_shmem(void)
|
|||||||
struct shmem_info *si;
|
struct shmem_info *si;
|
||||||
|
|
||||||
for_each_shmem(i, si) {
|
for_each_shmem(i, si) {
|
||||||
|
if (si->pid == SYSVIPC_SHMEM_PID)
|
||||||
|
continue;
|
||||||
ret = dump_one_shmem(si);
|
ret = dump_one_shmem(si);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
Reference in New Issue
Block a user