]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount-util: tweak flags decoding in mount_verbose_full()
authorLennart Poettering <lennart@poettering.net>
Thu, 29 Jun 2023 10:55:43 +0000 (12:55 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 29 Jun 2023 21:15:16 +0000 (22:15 +0100)
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

index 030648ec1b7c4d067abf69eb42d6877d69eb0fbc..83aa3fa6523e0efa14c233b4350dd0f81ea1e5aa 100644 (file)
@@ -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)