mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
fix: crash observed when position of drives different (#9490)
allocate the disk slice properly before populating disk by its ID and its position. Fixes #9416
This commit is contained in:
parent
da87188ff8
commit
c2529260e7
@ -333,12 +333,15 @@ func newXLSets(ctx context.Context, endpoints Endpoints, storageDisks []StorageA
|
|||||||
for i := 0; i < setCount; i++ {
|
for i := 0; i < setCount; i++ {
|
||||||
s.xlDisks[i] = make([]StorageAPI, drivesPerSet)
|
s.xlDisks[i] = make([]StorageAPI, drivesPerSet)
|
||||||
s.xlLockers[i] = make([]dsync.NetLocker, drivesPerSet)
|
s.xlLockers[i] = make([]dsync.NetLocker, drivesPerSet)
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < setCount; i++ {
|
||||||
var endpoints Endpoints
|
var endpoints Endpoints
|
||||||
for j := 0; j < drivesPerSet; j++ {
|
for j := 0; j < drivesPerSet; j++ {
|
||||||
endpoints = append(endpoints, s.endpoints[i*drivesPerSet+j])
|
endpoints = append(endpoints, s.endpoints[i*drivesPerSet+j])
|
||||||
// Rely on endpoints list to initialize, init lockers and available disks.
|
// Rely on endpoints list to initialize, init lockers and available disks.
|
||||||
s.xlLockers[i][j] = newLockAPI(s.endpoints[i*drivesPerSet+j])
|
s.xlLockers[i][j] = newLockAPI(s.endpoints[i*drivesPerSet+j])
|
||||||
|
|
||||||
disk := storageDisks[i*drivesPerSet+j]
|
disk := storageDisks[i*drivesPerSet+j]
|
||||||
if disk == nil {
|
if disk == nil {
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user