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

conf: fix read-only bind mounts #3323

Merged
merged 1 commit into from
Mar 24, 2020
Merged

Conversation

tych0
Copy link
Member

@tych0 tych0 commented Mar 24, 2020

Here we would always set MS_RDONLY in required_flags if it was set in
mountflags, so the expression:

!(required_flags & ~mountflags)

would always be true, and we would always skip the remount.

Instead, let's treat readonly as special: always do the remount if
MS_RDONLY is present. Unfortunately it doesn't seem to show up in
sb.f_flag, so we can't use the same path as everything else.

This only inadvertently worked before because of a bug fixed in
f759178 ("conf: don't accidently double-mount").

Signed-off-by: Tycho Andersen tycho@tycho.ws

Here we would always set MS_RDONLY in required_flags if it was set in
mountflags, so the expression:

!(required_flags & ~mountflags)

would always be true, and we would always skip the remount.

Instead, let's treat readonly as special: always do the remount if
MS_RDONLY is present. Unfortunately it doesn't seem to show up in
sb.f_flag, so we can't use the same path as everything else.

This only inadvertently worked before because of a bug fixed in
f759178 ("conf: don't accidently double-mount").

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
@lxc-jenkins
Copy link

Testsuite passed

@brauner
Copy link
Member

brauner commented Mar 24, 2020

Thanks for that!

@brauner brauner merged commit b492fc2 into lxc:master Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants