From: Lennart Poettering Date: Thu, 29 Jun 2023 10:55:43 +0000 (+0200) Subject: mount-util: tweak flags decoding in mount_verbose_full() X-Git-Tag: v254-rc1~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f56f9c6b3edcf08cf2a1a242de7ef5bc7da3d76e;p=thirdparty%2Fsystemd.git 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. --- 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)