mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
binfmt_misc: restore current work directory after restoring mnt ns
Restore current work directory after restoring mnt ns, otherwise "stats-dump" will been written to / Signed-off-by: Liu Hua <weldonliu@tencent.com>
This commit is contained in:
parent
eea63587e6
commit
f79d15c44d
1 changed files with 3 additions and 3 deletions
|
|
@ -1511,10 +1511,10 @@ err:
|
|||
static __maybe_unused int mount_cr_time_mount(struct ns_id *ns, unsigned int *s_dev, const char *source,
|
||||
const char *target, const char *type)
|
||||
{
|
||||
int mnt_fd, ret, exit_code = 0;
|
||||
int mnt_fd, cwd_fd, ret, exit_code = 0;
|
||||
struct stat st;
|
||||
|
||||
ret = switch_ns(ns->ns_pid, &mnt_ns_desc, &mnt_fd);
|
||||
ret = switch_mnt_ns(ns->ns_pid, &mnt_fd, &cwd_fd);
|
||||
if (ret < 0) {
|
||||
pr_err("Can't switch mnt_ns\n");
|
||||
goto out;
|
||||
|
|
@ -1536,7 +1536,7 @@ static __maybe_unused int mount_cr_time_mount(struct ns_id *ns, unsigned int *s_
|
|||
}
|
||||
|
||||
restore_ns:
|
||||
ret = restore_ns(mnt_fd, &mnt_ns_desc);
|
||||
ret = restore_mnt_ns(mnt_fd, &cwd_fd);
|
||||
out:
|
||||
return ret < 0 ? 0 : exit_code;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue