From 5d0f1ad90dfec35f04232a61e2300c601fb6762f Mon Sep 17 00:00:00 2001 From: Rogerio Guerra Borin Date: Tue, 20 Feb 2024 14:50:35 -0300 Subject: [PATCH] ostree-prepare-root: Amend comment about shared mounts Signed-off-by: Rogerio Guerra Borin --- src/switchroot/ostree-prepare-root-static.c | 9 ++++----- src/switchroot/ostree-prepare-root.c | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/switchroot/ostree-prepare-root-static.c b/src/switchroot/ostree-prepare-root-static.c index ce3340f83d..3995a6f0fb 100644 --- a/src/switchroot/ostree-prepare-root-static.c +++ b/src/switchroot/ostree-prepare-root-static.c @@ -204,12 +204,11 @@ main (int argc, char *argv[]) const bool sysroot_readonly = sysroot_is_configured_ro (root_arg); const bool sysroot_currently_writable = !path_is_on_readonly_fs (root_arg); - /* Work-around for a kernel bug: for some reason the kernel - * refuses switching root if any file systems are mounted - * MS_SHARED. Hence remount them MS_PRIVATE here as a - * work-around. + /* Remount root MS_PRIVATE here to avoid errors due to the kernel-enforced + * constraint that disallows MS_SHARED mounts to be moved. * - * https://bugzilla.redhat.com/show_bug.cgi?id=847418 */ + * Kernel docs: Documentation/filesystems/sharedsubtree.txt + */ if (mount (NULL, "/", NULL, MS_REC | MS_PRIVATE | MS_SILENT, NULL) < 0) err (EXIT_FAILURE, "failed to make \"/\" private mount"); diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index c4e236d402..4f260064c6 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -326,12 +326,11 @@ main (int argc, char *argv[]) g_print ("sysroot.readonly configuration value: %d (fs writable: %d)\n", (int)sysroot_readonly, (int)sysroot_currently_writable); - /* Work-around for a kernel bug: for some reason the kernel - * refuses switching root if any file systems are mounted - * MS_SHARED. Hence remount them MS_PRIVATE here as a - * work-around. + /* Remount root MS_PRIVATE here to avoid errors due to the kernel-enforced + * constraint that disallows MS_SHARED mounts to be moved. * - * https://bugzilla.redhat.com/show_bug.cgi?id=847418 */ + * Kernel docs: Documentation/filesystems/sharedsubtree.txt + */ if (mount (NULL, "/", NULL, MS_REC | MS_PRIVATE | MS_SILENT, NULL) < 0) err (EXIT_FAILURE, "failed to make \"/\" private mount");