-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
bugfix(mount): lstat with abs path of parent instead of '/..' #58433
bugfix(mount): lstat with abs path of parent instead of '/..' #58433
Conversation
pkg/util/mount/mount_linux.go
Outdated
@@ -265,7 +265,7 @@ func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) { | |||
if err != nil { | |||
return true, err | |||
} | |||
rootStat, err := os.Lstat(file + "/..") | |||
rootStat, err := os.Lstat(filepath.Dir(strings.TrimSuffix("/"))) |
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.
I'm not sure whether trying to remove tailing slash here is necessary
/ok-to-test |
d7e0377
to
c398269
Compare
/kind bug |
/sig storage |
/assign |
/lgtm |
/test pull-kubernetes-e2e-kubeadm-gce-canary |
@yue9944882: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, msau42, yue9944882 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 OWNERS Files:
Approvers can indicate their approval by writing |
Automatic merge from submit-queue (batch tested with PRs 59103, 58433). If you want to cherry-pick this change to another branch, please follow the instructions here. |
…33-upstream-release-1.8 Automatic merge from submit-queue. Automated cherry pick of #58433: bugfix(mount): lstat with abs path of parent instead of '/..' Cherry pick of #58433 on release-1.8. #58433: bugfix(mount): lstat with abs path of parent instead of '/..' ```release-note Fix a regression that prevented cleanup of a `subPath` volume mount ```
…33-upstream-release-1.9 Automatic merge from submit-queue. Automated cherry pick of #58433: bugfix(mount): lstat with abs path of parent instead of '/..' Cherry pick of #58433 on release-1.9. #58433: bugfix(mount): lstat with abs path of parent instead of '/..' Fixes: #61178 ```release-note Fix a regression that prevented cleanup of a `subPath` volume mount ```
…33-upstream-release-1.7 Automatic merge from submit-queue. Automated cherry pick of #58433: bugfix(mount): lstat with abs path of parent instead of '/..' Cherry pick of #58433 on release-1.7. #58433: bugfix(mount): lstat with abs path of parent instead of '/..' ```release-note Fix a regression that prevented cleanup of a `subPath` volume mount ```
Automatic merge from submit-queue (batch tested with PRs 61608, 62304). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove isNotDir error check **What this PR does / why we need it**: This check was supposed to handle the "subpath file" scenario, but: 1. It's wrong (should have been !) 2. It's not needed anymore. `IsLikelyNotMountPoint` was fixed to handle file mounts via #58433 **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**: ```release-note NONE ```
Automatic merge from submit-queue (batch tested with PRs 61608, 62304). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove isNotDir error check **What this PR does / why we need it**: This check was supposed to handle the "subpath file" scenario, but: 1. It's wrong (should have been !) 2. It's not needed anymore. `IsLikelyNotMountPoint` was fixed to handle file mounts via kubernetes/kubernetes#58433 **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**: ```release-note NONE ```
What this PR does / why we need it:
If a nfs volume with improper permission is mounted on a Pod, operation of deleting this Pod will fail and the pod itself will be stuck at a 'TERMINATING' status. Kubelet cannot reconcile it correctly.
This is because kubelet will try to find the mount-point with '..' file which needs
x
permission of dir. When it's forbidden, the nfs volume will never umount without a correct mount-point finded.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 #57095
Special notes for your reviewer:
Release note: