Skip to content

Commit af5928b

Browse files
committed
Volume expand: Consider peer id while checking available size
If a device exists with same name in different Peer, it is possible to get the available size information of the device from different Peer than getting information locally. Signed-off-by: Aravinda VK <[email protected]>
1 parent 1cd9746 commit af5928b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/device/deviceutils/store-utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ func IsVgExist(vgname string) bool {
180180
}
181181

182182
// getDeviceAvailableSize gets the device size and vgName using device Path
183-
func getDeviceAvailableSize(devicePath string) (string, uint64, error) {
184-
devices, err := GetDevices()
183+
func getDeviceAvailableSize(peerid, devicePath string) (string, uint64, error) {
184+
devices, err := GetDevices(peerid)
185185
if err != nil {
186186
return "", 0, err
187187
}
@@ -216,7 +216,7 @@ func CheckForAvailableVgSize(expansionSize uint64, bricksInfo []brick.Brickinfo)
216216
// Check in the map prepared in last step by looking through devices names and device available size of bricks from current node.
217217
for _, b := range bricksInfo {
218218
// retrieve device available size by device Name and return the vgName and available device Size.
219-
vgName, deviceSize, err := getDeviceAvailableSize(b.MountInfo.DevicePath)
219+
vgName, deviceSize, err := getDeviceAvailableSize(b.PeerID.String(), b.MountInfo.DevicePath)
220220
if err != nil {
221221
return map[string]string{}, false, err
222222
}

0 commit comments

Comments
 (0)