aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorchrislusf <chris.lu@gmail.com>2025-12-06 12:40:48 -0800
committerChris Lu <chrislusf@users.noreply.github.com>2025-12-06 18:53:22 -0800
commitb9c9efcf507a8b58c05e6439d6efd68f0c6b6f88 (patch)
treeb7440d3148e39ae4ac3663a6287080cca5f982bf /pkg
parent7f74627d1fc93b2ffe36a4193f9125bbeaf8cc0e (diff)
downloadseaweedfs-csi-driver-b9c9efcf507a8b58c05e6439d6efd68f0c6b6f88.tar.xz
seaweedfs-csi-driver-b9c9efcf507a8b58c05e6439d6efd68f0c6b6f88.zip
fix: remove redundant unmount call in Unmount function
The weedMountProcess.wait() function already handles unmounting when the process terminates. Removing the explicit unmount call in Unmount() centralizes the unmount logic and avoids potential race conditions.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/mountmanager/manager.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/pkg/mountmanager/manager.go b/pkg/mountmanager/manager.go
index 493333a..7d6a908 100644
--- a/pkg/mountmanager/manager.go
+++ b/pkg/mountmanager/manager.go
@@ -99,12 +99,9 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) {
return &UnmountResponse{}, nil
}
- if ok, err := kubeMounter.IsMountPoint(entry.targetPath); ok || mount.IsCorruptedMnt(err) {
- if err = kubeMounter.Unmount(entry.targetPath); err != nil {
- return nil, err
- }
- }
-
+ // Note: We don't explicitly unmount here because weedMountProcess.wait()
+ // handles the unmount when the process terminates (either gracefully or forcefully).
+ // This centralizes unmount logic and avoids potential race conditions.
if err := entry.process.stop(); err != nil {
return nil, err
}