-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve mountinfo filtering for hotplugging NFS disks #9591
Conversation
@@ -192,12 +192,21 @@ func MountInfoRoot(r IsolationResult) (mountinfo *mount.Info, err error) { | |||
return mountInfoFor(r, "/") | |||
} | |||
|
|||
func mountsFilter(compare, m *mount.Info, source string) (bool, bool) { | |||
nfsMatch := false | |||
if m.FSType == "nfs4" && compare.FSType == m.FSType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about nfs3 or m.FSType == "nfs"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support nfs3, just nfs4, but I can make the test be like strings.contains(m.fsType, "nfs")
When a VM was running multiple NFS disks (one boot disk) and one hotplugged disk. The mount filtering was returning multiple possible mounts on the host, and sorting on the length of the 'root' path of the mount. For NFS these are the same (/). This caused the wrong NFS mount to be picked when hotplugging and an attempt was made to hotplug the boot disk. This commit improves the situation by passing the 'source' field to the filter, and it filters out entries that don't have matching sources. This allows us to find the correct mount on the host. Signed-off-by: Alexander Wels <awels@redhat.com>
if multiple match the filter, the longest root is selected per the sort of the length of the root Changed check from exact nfs4 to prefix nfs to handle other possible nfs versions Signed-off-by: Alexander Wels <awels@redhat.com>
c97b79e
to
4f812aa
Compare
/retest-required |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mhenriks The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest-required |
2 similar comments
/retest-required |
/retest-required |
@awels: The following tests failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest-required |
/test pull-kubevirt-e2e-arm64 |
/cherrypick release-0.59 |
@awels: new pull request created: #9825 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What this PR does / why we need it:
When a VM was running multiple NFS disks (one boot disk) and one hotplugged disk. The mount filtering was returning multiple possible mounts on the host, and sorting on the length of the 'root' path of the mount. For NFS these are the same (/). This caused the wrong NFS mount to be picked when hotplugging and an attempt was made to hotplug the boot disk. This commit improves the situation by passing the 'source' field to the filter, and it filters out entries that don't have matching sources. This allows us to find the correct mount on the host.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note: