@@ -3,7 +3,6 @@ package driver
3
3
import (
4
4
"context"
5
5
"strconv"
6
- "sync"
7
6
8
7
"github.com/container-storage-interface/spec/lib/go/csi"
9
8
"github.com/scaleway/scaleway-csi/pkg/scaleway"
@@ -61,8 +60,6 @@ var _ csi.ControllerServer = &controllerService{}
61
60
type controllerService struct {
62
61
scaleway scaleway.Interface
63
62
config * DriverConfig
64
- // Global attach/detach mutex.
65
- mux sync.Mutex
66
63
// Volume locks ensures we don't run parallel operations on volumes (e.g.
67
64
// detaching a volume and taking a snapshot).
68
65
locks namedlocker.Store
@@ -220,8 +217,6 @@ func (d *controllerService) ControllerPublishVolume(ctx context.Context, req *cs
220
217
return nil , status .Errorf (codes .ResourceExhausted , "max number of volumes reached for instance %s" , nodeID )
221
218
}
222
219
223
- d .mux .Lock ()
224
- defer d .mux .Unlock ()
225
220
if err := d .scaleway .AttachVolume (ctx , nodeID , volumeID , volumeZone ); err != nil {
226
221
return nil , status .Errorf (codes .Internal , "failed to attach volume to instance: %s" , err )
227
222
}
@@ -273,8 +268,6 @@ func (d *controllerService) ControllerUnpublishVolume(ctx context.Context, req *
273
268
return nil , status .Errorf (code , "failed to get server where to unpublish volume: %s" , err )
274
269
}
275
270
276
- d .mux .Lock ()
277
- defer d .mux .Unlock ()
278
271
if err := d .scaleway .DetachVolume (ctx , volumeID , volumeZone ); err != nil {
279
272
return nil , status .Errorf (codes .Internal , "failed to detach volume: %s" , err )
280
273
}
0 commit comments