mount-util: make "prefix" parameter optional for umount_recursive()

When switching root via MS_MOVE there's no need to filter the mount
table by prefix
This commit is contained in:
Lennart Poettering
2023-05-17 10:29:05 +02:00
parent 84bcb394c8
commit ef742415e6
+3 -1
View 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 */