diff options
| author | chrislusf <chris.lu@gmail.com> | 2025-12-06 12:40:48 -0800 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2025-12-06 12:40:48 -0800 |
| commit | aea7488f8c0808fc02db648680d8b9fd588443ed (patch) | |
| tree | b7440d3148e39ae4ac3663a6287080cca5f982bf | |
| parent | 4c658db9b17ede34745d9658a67d8fc40f481950 (diff) | |
| download | seaweedfs-csi-driver-aea7488f8c0808fc02db648680d8b9fd588443ed.tar.xz seaweedfs-csi-driver-aea7488f8c0808fc02db648680d8b9fd588443ed.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.
| -rw-r--r-- | pkg/mountmanager/manager.go | 9 |
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 } |
