From: Lennart Poettering Date: Mon, 15 May 2023 19:23:55 +0000 (+0200) Subject: mount-util: make "prefix" parameter optional for umount_recursive() X-Git-Tag: v254-rc1~441^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef742415e61822c5a746f1b0d29d1808f64680e5;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index c97a7c3188e..6dbb65ce106 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -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 */