Commit 8494d708 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

irmap: Duplicate handle memory when queueing for predump

With the recent cleanups in fdinfo parsing the memory
allocation policy for entries has changed, thus keeping
a pointer on the entry handle is no longer valid (it
will be freed soon).

Said that -- duplicate the memory for queued irmap work.

https://github.com/xemul/criu/issues/328Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 70c0b47d
......@@ -311,7 +311,12 @@ int irmap_queue_cache(unsigned int dev, unsigned long ino,
ip->dev = dev;
ip->ino = ino;
ip->fh = *fh;
fh->handle = NULL; /* don't free in free_fhandle */
ip->fh.handle = xmemdup(fh->handle,
FH_ENTRY_SIZES__min_entries * sizeof(uint64_t));
if (!ip->fh.handle) {
xfree(ip);
return -1;
}
pr_debug("Queue %x:%lx for pre-dump\n", dev, ino);
......
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