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.
This commit is contained in:
Lennart Poettering
2023-06-29 22:15:16 +01:00
committed by Luca Boccassi
parent eb99c45914
commit f56f9c6b3e
+8 -5
View 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)