From 798e811733f4a85bf51672ce8bcdb649a1173711 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 3 Jun 2023 09:17:45 +0200 Subject: [PATCH] umount: /usr/ should never be unmounted regardless of HAVE_SPLIT_USR or not Whether we put some binaries in /bin or in /usr/bin should not have any effect on unmounting during shutdown. Even if people split /usr/ off we should not try to unmount it, no matter what as it is simply where binaries are placed. --- src/shutdown/umount.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c index 6cbe2befa2..1586c2e214 100644 --- a/src/shutdown/umount.c +++ b/src/shutdown/umount.c @@ -168,11 +168,10 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) { } static bool nonunmountable_path(const char *path) { - return path_equal(path, "/") -#if ! HAVE_SPLIT_USR - || path_equal(path, "/usr") -#endif - || path_startswith(path, "/run/initramfs"); + assert(path); + + return PATH_IN_SET(path, "/", "/usr") || + path_startswith(path, "/run/initramfs"); } static void log_umount_blockers(const char *mnt) {