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

driver: check if the mounts are propagated #46

Merged
merged 2 commits into from
Aug 2, 2018
Merged

Conversation

fatih
Copy link
Contributor

@fatih fatih commented Aug 1, 2018

Make sure mount propagation is enabled. We can check it by using
findmnt with the PROPAGATION label.

Also fix an issue to check the mounted path for the target path where
checking against the staging target path won't work as findmnt only
works on devices

Make sure mount propagation is enabled. We can check it by using
`findmnt` with the `PROPAGATION` label.

Also fix an issue to check the mounted path for the target path where
checking against the staging target path won't work as findmnt only
works on devices

// the mountpoint should match as well
if fs.Target == target {
targetFound = true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return true, nil and get rid of targetFound

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, but we can't do it because there might be two mount points. If the first one is shared and it fits the target, if we early return in this case, we might miss the second one (which could be private for example). However I removed this piece:

	if targetFound {
		return true, nil
	}

	return false, nil

to

	return targetFound, nil

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@lxfontes
Copy link

lxfontes commented Aug 1, 2018

lgtm

@lxfontes
Copy link

lxfontes commented Aug 2, 2018

🚀

@fatih fatih merged commit 719c0da into master Aug 2, 2018
@fatih fatih deleted the handle-propagation branch August 3, 2018 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants