From: Karel Zak Date: Wed, 12 Oct 2022 11:00:12 +0000 (+0200) Subject: libmount: (owner) call hooks when all mount stuff is done X-Git-Tag: v2.39-rc1~235 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fe408964d0b431a69aed9ff8846d9106212bce6;p=thirdparty%2Futil-linux.git libmount: (owner) call hooks when all mount stuff is done Signed-off-by: Karel Zak --- 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; }