From: Karel Zak Date: Wed, 12 Oct 2022 09:15:25 +0000 (+0200) Subject: libmount: check for propagation-only in proper way X-Git-Tag: v2.39-rc1~238 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=664d1d4984fd550dca19424167fd1dc6e03df867;p=thirdparty%2Futil-linux.git libmount: check for propagation-only in proper way Signed-off-by: Karel Zak --- diff --git a/libmount/src/hook_mount.c b/libmount/src/hook_mount.c index 41d71a85dc..6f7020fe2a 100644 --- a/libmount/src/hook_mount.c +++ b/libmount/src/hook_mount.c @@ -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); diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c index d7ef61a79b..2f6e1f4073 100644 --- a/libmount/src/optlist.c +++ b/libmount/src/optlist.c @@ -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))); }