From 664d1d4984fd550dca19424167fd1dc6e03df867 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 12 Oct 2022 11:15:25 +0200 Subject: [PATCH] libmount: check for propagation-only in proper way Signed-off-by: Karel Zak --- libmount/src/hook_mount.c | 2 +- libmount/src/optlist.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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))); } -- 2.47.3