mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
criu/files: Don't cache fd ids for device files
Restore operation fails when we perform CR operation of multiple independent proceses that have device files because criu caches the ids for the device files with same mnt_ids, inode pair. This change ensures that even in case of a cached id found for a device, a unique subid is generated and returned which is used for dumping. Suggested-by: Andrei Vagin <avagin@gmail.com> Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
This commit is contained in:
parent
7b6239b6dd
commit
74d1233b59
1 changed files with 8 additions and 2 deletions
|
|
@ -77,8 +77,14 @@ int fd_id_generate_special(struct fd_parms *p, u32 *id)
|
|||
|
||||
fi = fd_id_cache_lookup(p);
|
||||
if (fi) {
|
||||
*id = fi->id;
|
||||
return 0;
|
||||
if (p->stat.st_mode & (S_IFCHR | S_IFBLK)) {
|
||||
/* Don't cache the id for mapped devices */
|
||||
*id = fd_tree.subid++;
|
||||
return 1;
|
||||
} else {
|
||||
*id = fi->id;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue