]> git.ipfire.org Git - thirdparty/systemd.git/commit
switch-root: when switching root via MS_MOVE unmount all remaining mounts first 27670/head
authorLennart Poettering <lennart@poettering.net>
Mon, 15 May 2023 19:25:12 +0000 (21:25 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 May 2023 08:30:47 +0000 (10:30 +0200)
commit268d1244e87a35ff8dff56c92ef375ebf69d462e
treec896af2c8368a85eef919622b30426ba6d2e5380
parent4e9ef660e6c56a4098e8535b3368c6c96f8630b1
switch-root: when switching root via MS_MOVE unmount all remaining mounts first

Let's try to unmount anything left, since if we don't they will remain
as "shadow" mounts, hidden underneath our new root.

This is only necessary when we transition into a new root via MS_MOVE.
If we do so via pivot_root() this is not necessary as the kernel will
get rid of the mounts anyway for us.
src/shared/switch-root.c