From f56f9c6b3edcf08cf2a1a242de7ef5bc7da3d76e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 29 Jun 2023 12:55:43 +0200 Subject: [PATCH] mount-util: tweak flags decoding in mount_verbose_full() Fine-tune the decoding of mount options in mount_verbose_full() to provide more helpful log output: 1. decode changing of propagation changes 2. discern changing of superblock flags/mount option string from mount flags 3. don't check secondary fields when deciding which mount op is executed, only the flags decide that. --- src/shared/mount-util.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index 030648ec1b7..83aa3fa6523 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -684,13 +684,16 @@ int mount_verbose_full( (void) mount_flags_to_string(f, &fl); - if ((f & MS_REMOUNT) && !what && !type) - log_debug("Remounting %s (%s \"%s\")...", + if (FLAGS_SET(f, MS_REMOUNT|MS_BIND)) + log_debug("Changing mount flags %s (%s \"%s\")...", where, strnull(fl), strempty(o)); - else if (!what && !type) - log_debug("Mounting %s (%s \"%s\")...", + else if (f & MS_REMOUNT) + log_debug("Remounting superblock %s (%s \"%s\")...", where, strnull(fl), strempty(o)); - else if ((f & MS_BIND) && !type) + else if (f & (MS_SHARED|MS_PRIVATE|MS_SLAVE|MS_UNBINDABLE)) + log_debug("Changing mount propagation %s (%s \"%s\")", + where, strnull(fl), strempty(o)); + else if (f & MS_BIND) log_debug("Bind-mounting %s on %s (%s \"%s\")...", what, where, strnull(fl), strempty(o)); else if (f & MS_MOVE) -- 2.47.3