fix: stale smb unmount issue when smb file share is deleted #694
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug
What this PR does / why we need it:
fix: state smb unmount issue when smb file share is deleted and then unmount
related to fix: kubernetes/kubernetes#121851
there is behavior change from linux kernel
5.15.0-1051-azure
(or earlier version), when smb file share is deleted, the upstream mount-utils depends on following logic to check whether smb mount is in stale state, while starting from the former kernel version, it returnsresource temporarily unavailable
error instead ofErrNotExist
, thus this PR tries to add a new judgement in the mount-utils inIsCorruptedMnt
func, hereEWOULDBLOCK
isresource temporarily unavailable
error.original logic (won't work now since it now returns it returns
resource temporarily unavailable
error instead ofErrNotExist
in kernel)https://github.com/kubernetes/kubernetes/blob/a95a79c785ec449074afc689306d1155aa039025/staging/src/k8s.io/mount-utils/mount_helper_unix.go#L188-L198
currunt error message is like following:
workaround
force delete the pod
impact
This issue does not only break CSI drivers, it also breaks on pods with subPath smb volume, error msg is like following, this requires a patch version fix of kubelet since subPath unmount does not go through CSI driver.
Which issue(s) this PR fixes:
Fixes #693
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: