aboutsummaryrefslogtreecommitdiff
path: root/pkg/mountmanager/manager.go
diff options
context:
space:
mode:
author泽淼 周 <zhouzemiao@ihuman.com>2025-09-28 17:09:12 +0800
committerchrislusf <chris.lu@gmail.com>2025-12-05 17:53:19 -0800
commitaf25eabb6fa135242c12b8cb9be978767ff1a1ac (patch)
tree3dfe950074555627ca23f029d1a71b4bbe5ba9bf /pkg/mountmanager/manager.go
parent069e59a8fcdcf3811e787e67c6b75ff921e0e572 (diff)
downloadseaweedfs-csi-driver-af25eabb6fa135242c12b8cb9be978767ff1a1ac.tar.xz
seaweedfs-csi-driver-af25eabb6fa135242c12b8cb9be978767ff1a1ac.zip
feat: add log
Diffstat (limited to 'pkg/mountmanager/manager.go')
-rw-r--r--pkg/mountmanager/manager.go19
1 files changed, 4 insertions, 15 deletions
diff --git a/pkg/mountmanager/manager.go b/pkg/mountmanager/manager.go
index 420300e..19662f3 100644
--- a/pkg/mountmanager/manager.go
+++ b/pkg/mountmanager/manager.go
@@ -58,7 +58,7 @@ func (m *Manager) Mount(req *MountRequest) (*MountResponse, error) {
if entry := m.getMount(req.VolumeID); entry != nil {
if entry.targetPath == req.TargetPath {
- glog.V(1).Infof("volume %s already mounted at %s", req.VolumeID, req.TargetPath)
+ glog.Infof("volume %s already mounted at %s", req.VolumeID, req.TargetPath)
return &MountResponse{LocalSocket: entry.localSocket}, nil
}
return nil, fmt.Errorf("volume %s already mounted at %s", req.VolumeID, entry.targetPath)
@@ -73,8 +73,7 @@ func (m *Manager) Mount(req *MountRequest) (*MountResponse, error) {
m.mounts[req.VolumeID] = entry
m.mu.Unlock()
- go m.watchMount(req.VolumeID, entry)
-
+ glog.Infof("started weed mount process for volume %s at %s", req.VolumeID, req.TargetPath)
return &MountResponse{LocalSocket: entry.localSocket}, nil
}
@@ -93,7 +92,7 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) {
entry := m.removeMount(req.VolumeID)
if entry == nil {
- glog.V(1).Infof("volume %s not mounted", req.VolumeID)
+ glog.Infof("volume %s not mounted", req.VolumeID)
return &UnmountResponse{}, nil
}
@@ -109,6 +108,7 @@ func (m *Manager) Unmount(req *UnmountRequest) (*UnmountResponse, error) {
return nil, err
}
+ glog.Infof("stopped weed mount process for volume %s at %s", req.VolumeID, entry.targetPath)
return &UnmountResponse{}, nil
}
@@ -127,17 +127,6 @@ func (m *Manager) removeMount(volumeID string) *mountEntry {
return entry
}
-func (m *Manager) watchMount(volumeID string, entry *mountEntry) {
- <-entry.process.done
- m.mu.Lock()
- current, ok := m.mounts[volumeID]
- if ok && current == entry {
- delete(m.mounts, volumeID)
- }
- m.mu.Unlock()
- os.RemoveAll(entry.cacheDir)
-}
-
func (m *Manager) startMount(req *MountRequest) (*mountEntry, error) {
targetPath := req.TargetPath
if err := ensureTargetClean(targetPath); err != nil {