ostree-prepare-root: Amend comment about shared mounts
authorRogerio Guerra Borin <rogerio.borin@toradex.com>
Tue, 20 Feb 2024 17:50:35 +0000 (14:50 -0300)
committerRogerio Guerra Borin <rogerio.borin@toradex.com>
Tue, 20 Feb 2024 18:07:51 +0000 (15:07 -0300)
Signed-off-by: Rogerio Guerra Borin <rogerio.borin@toradex.com>
src/switchroot/ostree-prepare-root-static.c
src/switchroot/ostree-prepare-root.c

index ce3340f83d311f0295aa4c5b7d98eeab5e21ca58..3995a6f0fb3ae20da23847a6d9dff8938b70048d 100644 (file)
@@ -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");
 
index c4e236d402a31d1475480ec51e4c45c84f49a3ba..4f260064c6745f631d11e4ab95b999a4aba0b182 100644 (file)
@@ -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");