From 0fe408964d0b431a69aed9ff8846d9106212bce6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 12 Oct 2022 13:00:12 +0200 Subject: [PATCH] libmount: (owner) call hooks when all mount stuff is done Signed-off-by: Karel Zak --- libmount/src/context_mount.c | 3 +++ libmount/src/hook_owner.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index 754eb809f5..938d34f8d4 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -1067,6 +1067,9 @@ again: } } + if (rc == 0) + rc = mnt_context_call_hooks(cxt, MNT_STAGE_POST); + mnt_context_deinit_hooksets(cxt); if (!mnt_context_switch_ns(cxt, ns_old)) diff --git a/libmount/src/hook_owner.c b/libmount/src/hook_owner.c index 9c23733a38..11b238c891 100644 --- a/libmount/src/hook_owner.c +++ b/libmount/src/hook_owner.c @@ -41,7 +41,7 @@ static int hookset_deinit(struct libmnt_context *cxt, const struct libmnt_hookse return 0; } -static int hook_mount_post( +static int hook_post( struct libmnt_context *cxt, const struct libmnt_hookset *hs __attribute__((__unused__)), void *data) @@ -150,8 +150,8 @@ static int hook_prepare_options( DBG(CXT, ul_debugobj(cxt, " wanted ownership %d:%d, mode %04o", hd->owner, hd->group, hd->mode)); rc = mnt_context_append_hook(cxt, hs, - MNT_STAGE_MOUNT_POST, - hd, hook_mount_post); + MNT_STAGE_POST, + hd, hook_post); if (rc < 0) goto fail; } -- 2.47.3