diff --git a/cr-restore.c b/cr-restore.c index 861fe0907b..9781fc2a30 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -1858,12 +1858,14 @@ static int restore_root_task(struct pstree_item *init) */ task_entries->nr_threads -= atomic_read(&task_entries->nr_zombies); - if (mnt_ns_fd >= 0) + if (mnt_ns_fd >= 0) { /* * Don't try_clean_remaps here, since restore went OK * and all ghosts were removed by the openers. */ close(mnt_ns_fd); + mnt_ns_fd = -1; + } cleanup_mnt_ns(); ret = stop_usernsd();