@@ -3,7 +3,6 @@ package driver
33import (
44 "context"
55 "strconv"
6- "sync"
76
87 "github.com/container-storage-interface/spec/lib/go/csi"
98 "github.com/scaleway/scaleway-csi/pkg/scaleway"
@@ -61,8 +60,6 @@ var _ csi.ControllerServer = &controllerService{}
6160type controllerService struct {
6261 scaleway scaleway.Interface
6362 config * DriverConfig
64- // Global attach/detach mutex.
65- mux sync.Mutex
6663 // Volume locks ensures we don't run parallel operations on volumes (e.g.
6764 // detaching a volume and taking a snapshot).
6865 locks namedlocker.Store
@@ -220,8 +217,6 @@ func (d *controllerService) ControllerPublishVolume(ctx context.Context, req *cs
220217 return nil , status .Errorf (codes .ResourceExhausted , "max number of volumes reached for instance %s" , nodeID )
221218 }
222219
223- d .mux .Lock ()
224- defer d .mux .Unlock ()
225220 if err := d .scaleway .AttachVolume (ctx , nodeID , volumeID , volumeZone ); err != nil {
226221 return nil , status .Errorf (codes .Internal , "failed to attach volume to instance: %s" , err )
227222 }
@@ -273,8 +268,6 @@ func (d *controllerService) ControllerUnpublishVolume(ctx context.Context, req *
273268 return nil , status .Errorf (code , "failed to get server where to unpublish volume: %s" , err )
274269 }
275270
276- d .mux .Lock ()
277- defer d .mux .Unlock ()
278271 if err := d .scaleway .DetachVolume (ctx , volumeID , volumeZone ); err != nil {
279272 return nil , status .Errorf (codes .Internal , "failed to detach volume: %s" , err )
280273 }
0 commit comments