mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 15:25:21 +00:00
files: Enlighten the rollback link-remap routine
When we don't do unlink no need to lookup for ns root-fd Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
13
files-reg.c
13
files-reg.c
@@ -459,12 +459,15 @@ static void __rollback_link_remaps(bool do_unlink)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
list_for_each_entry_safe(rlb, tmp, &link_remaps, list) {
|
list_for_each_entry_safe(rlb, tmp, &link_remaps, list) {
|
||||||
mntns_root = mntns_get_root_fd(rlb->mnt_ns);
|
if (do_unlink) {
|
||||||
if (mntns_root < 0)
|
mntns_root = mntns_get_root_fd(rlb->mnt_ns);
|
||||||
return;
|
if (mntns_root >= 0)
|
||||||
|
unlinkat(mntns_root, rlb->path, 0);
|
||||||
|
else
|
||||||
|
pr_err("Failed to clenaup %s link remap\n", rlb->path);
|
||||||
|
}
|
||||||
|
|
||||||
list_del(&rlb->list);
|
list_del(&rlb->list);
|
||||||
if (do_unlink)
|
|
||||||
unlinkat(mntns_root, rlb->path, 0);
|
|
||||||
xfree(rlb->path);
|
xfree(rlb->path);
|
||||||
xfree(rlb);
|
xfree(rlb);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user