Description
What happened:
When multiple pods mount the same SMB PVC on the same node, everything works fine initially. However, when one of the pods terminates, the kubelet continuously tries to remove the mount, but fails because it is still in use by the other running pods.
This leads to repeated errors like this in the kubelet logs:
E0318 17:59:39.117298 3433 nestedpendingoperations.go:348] Operation for "{volumeName:kubernetes.io/csi/smb.csi.k8s.io^bdreporting.local/prod#pvc-bef1050f-315f-4d4e-b6cd-e34852707289## podName: nodeName:}" failed. No retries permitted until 2025-03-18 18:01:41.117272093 +0000 UTC m=+512314.416251152 (durationBeforeRetry 2m2s). Error: GetDeviceMountRefs check failed for volume "pvc-bef1050f-315f-4d4e-b6cd-e34852707289" (UniqueName: "kubernetes.io/csi/smb.csi.k8s.io^bdreporting.local/prod#pvc-bef1050f-315f-4d4e-b6cd-e34852707289##") on node "k8s-se-platform-02-vktnv-worker-0-l7hmt" : the device mount path "/var/lib/kubelet/plugins/kubernetes.io/csi/smb.csi.k8s.io/c610e0382b580c4274e6cfd0f86f29b1b4a9fef6865ea6ff304f804c1cdffaf8/globalmount" is still mounted by other references [...]
This situation causes the kubelet to get stuck in a loop, retrying the operation but never succeeding, since other pods on the same node are still using the SMB mount.
In some cases, this appears to contribute to node instability, including kernel panics.
What you expected to happen:
Kubelet should correctly handle multiple pods using the same SMB volume on the same node.
Unmounting the volume for one pod should not interfere with the other pods still using it.
Kubelet should not get stuck in a loop trying to unmount a volume that is still in use.
No kernel panics or node instability should result from this scenario.
How to reproduce it:
Deploy a StatefulSet or multiple pods that mount the same SMB PVC on a single node.
Verify the mount paths:
mount | grep kubernetes.io/csi
You should see the same mount path used by multiple pods.
Delete one of the pods.
Check kubelet logs (journalctl -u kubelet -f) to observe errors.
See if the kubelet continuously tries to remove the mount but fails due to "still mounted by other references."
Environment:
- CSI Driver version: smbplugin:v1.17.0
- Kubernetes version (use
kubectl version
): v1.30.6-dirty - OS (e.g. from /etc/os-release): CentOS Stream CoreOS
- Kernel: 5.14.0-536.el9.x86_64
- Install tools:
- Others: