Re: [systemd-devel] [PATCH] switch-root: umount the old root correctly
On Tue, Jul 29, 2014 at 03:31:23PM -0400, Dan Dedrick wrote: The unmount occurs after the pivot_root, so the path used to unmount should take into account the new root directory. This will allow the umount to actually succeed. --- src/core/switch-root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/switch-root.c b/src/core/switch-root.c index f82243f..f508cc2 100644 --- a/src/core/switch-root.c +++ b/src/core/switch-root.c @@ -129,8 +129,8 @@ int switch_root(const char *new_root) { /* Immediately get rid of the old root. Since we are * running off it we need to do this lazily. */ -if (umount2(temporary_old_root, MNT_DETACH) 0) { -log_error(Failed to umount old root dir %s: %m, temporary_old_root); +if (umount2(/mnt, MNT_DETACH) 0) { +log_error(Failed to umount old root dir /mnt: %m); return -errno; } Applied. Zbyszek ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] switch-root: umount the old root correctly
The unmount occurs after the pivot_root, so the path used to unmount should take into account the new root directory. This will allow the umount to actually succeed. --- src/core/switch-root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/switch-root.c b/src/core/switch-root.c index f82243f..f508cc2 100644 --- a/src/core/switch-root.c +++ b/src/core/switch-root.c @@ -129,8 +129,8 @@ int switch_root(const char *new_root) { /* Immediately get rid of the old root. Since we are * running off it we need to do this lazily. */ -if (umount2(temporary_old_root, MNT_DETACH) 0) { -log_error(Failed to umount old root dir %s: %m, temporary_old_root); +if (umount2(/mnt, MNT_DETACH) 0) { +log_error(Failed to umount old root dir /mnt: %m); return -errno; } -- 1.9.3 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel