]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: check for propagation-only in proper way
authorKarel Zak <kzak@redhat.com>
Wed, 12 Oct 2022 09:15:25 +0000 (11:15 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:58:42 +0000 (12:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/hook_mount.c
libmount/src/optlist.c

index 41d71a85dc4fe3100890271ab258412c1bc63600..6f7020fe2ad209a6196517c4de3befd0622c8bbb 100644 (file)
@@ -528,7 +528,7 @@ static int hook_prepare(struct libmnt_context *cxt,
            && !(flags & MS_BIND)
            && !(flags & MS_MOVE)
            && !(flags & MS_REMOUNT)
-           && !mnt_optlist_is_propagation_only(ol))
+           && !mnt_context_propagation_only(cxt))
                rc = mnt_context_append_hook(cxt, hs, MNT_STAGE_MOUNT, NULL,
                                        hook_create_mount);
 
index d7ef61a79b00ceff5d435da2a9fecd87997e7399..2f6e1f40730e27fc9f31f3428ad6a1bdda72462a 100644 (file)
@@ -984,6 +984,9 @@ int mnt_optlist_is_propagation_only(struct libmnt_optlist *ls)
                return 0;
 
        rest = flags & ~MS_PROPAGATION;
+       DBG(OPTLIST, ul_debugobj(ls, " propagation-only: %s",
+               (rest == 0 || (rest & (MS_SILENT | MS_REC)) ? "y" : "n")));
+
        return (rest == 0 || (rest & (MS_SILENT | MS_REC)));
 }