]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount-util: make "prefix" parameter optional for umount_recursive()
authorLennart Poettering <lennart@poettering.net>
Mon, 15 May 2023 19:23:55 +0000 (21:23 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 May 2023 08:29:05 +0000 (10:29 +0200)
When switching root via MS_MOVE there's no need to filter the mount
table by prefix

src/shared/mount-util.c

index c97a7c3188e72b7a96cbec9e800b9287200bb692..6dbb65ce1069238adb46593bed723f5744c1e84a 100644 (file)
@@ -78,8 +78,10 @@ int umount_recursive_full(const char *prefix, int flags, char **keep) {
                         if (!path)
                                 continue;
 
-                        if (!path_startswith(path, prefix))
+                        if (prefix && !path_startswith(path, prefix)) {
+                                log_debug("Not unmounting %s, outside of prefix: %s", path, prefix);
                                 continue;
+                        }
 
                         STRV_FOREACH(k, keep)
                                 /* Match against anything in the path to the dirs to keep, or below the dirs to keep */