|
@ -76,7 +76,7 @@ func (ms *MasterServer) volumeGrowHandler(w http.ResponseWriter, r *http.Request |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if count, err = strconv.Atoi(r.FormValue("count")); err == nil { |
|
|
if count, err = strconv.Atoi(r.FormValue("count")); err == nil { |
|
|
if ms.Topo.FreeSpace() < int64(count*option.ReplicaPlacement.GetCopyCount()) { |
|
|
|
|
|
|
|
|
if ms.Topo.AvailableSpaceFor(option) < int64(count*option.ReplicaPlacement.GetCopyCount()) { |
|
|
err = fmt.Errorf("only %d volumes left, not enough for %d", ms.Topo.FreeSpace(), count*option.ReplicaPlacement.GetCopyCount()) |
|
|
err = fmt.Errorf("only %d volumes left, not enough for %d", ms.Topo.FreeSpace(), count*option.ReplicaPlacement.GetCopyCount()) |
|
|
} else { |
|
|
} else { |
|
|
count, err = ms.vg.GrowByCountAndType(ms.grpcDialOption, count, option, ms.Topo) |
|
|
count, err = ms.vg.GrowByCountAndType(ms.grpcDialOption, count, option, ms.Topo) |
|
|