Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ostree-prepare-root: Amend comment about shared mounts #3186

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/switchroot/ostree-prepare-root-static.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
9 changes: 4 additions & 5 deletions src/switchroot/ostree-prepare-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Loading