Merge pull request #3186 from rborn-tx/amend-ms-shared-comment

ostree-prepare-root: Amend comment about shared mounts
This commit is contained in:
Joseph Marrero Corchado 2024-02-21 07:53:32 -05:00 committed by GitHub
commit 8f98143d64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 10 deletions

View 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");

View File

@ -327,12 +327,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");