diff --git a/cmd/server-startup-msg.go b/cmd/server-startup-msg.go index bf037db73..291e38bef 100644 --- a/cmd/server-startup-msg.go +++ b/cmd/server-startup-msg.go @@ -133,13 +133,9 @@ func printObjectAPIMsg() { // Get formatted disk/storage info message. func getStorageInfoMsg(storageInfo StorageInfo) string { - freeSpace := uint64(storageInfo.Free) - totalSpace := uint64(storageInfo.Total) - if storageInfo.Backend.Type == XL { - freeSpace /= 2 - totalSpace /= 2 - } - msg := fmt.Sprintf("%s %s Free, %s Total", colorBlue("Drive Capacity:"), humanize.IBytes(freeSpace), humanize.IBytes(totalSpace)) + msg := fmt.Sprintf("%s %s Free, %s Total", colorBlue("Drive Capacity:"), + humanize.IBytes(uint64(storageInfo.Free)), + humanize.IBytes(uint64(storageInfo.Total))) diskInfo := fmt.Sprintf(" %d Online, %d Offline. We can withstand [%d] more drive failure(s).", storageInfo.Backend.OnlineDisks, storageInfo.Backend.OfflineDisks, diff --git a/cmd/server-startup-msg_test.go b/cmd/server-startup-msg_test.go index 2c57d1c97..6ec443046 100644 --- a/cmd/server-startup-msg_test.go +++ b/cmd/server-startup-msg_test.go @@ -39,8 +39,8 @@ func TestStorageInfoMsg(t *testing.T) { }{XL, 7, 1, 4, 5}, } - if msg := getStorageInfoMsg(infoStorage); !strings.Contains(msg, "1.0 GiB Free, 5.0 GiB Total") || !strings.Contains(msg, "7 Online, 1 Offline") { - t.Fatal("Empty message string is not implemented", msg) + if msg := getStorageInfoMsg(infoStorage); !strings.Contains(msg, "2.0 GiB Free, 10 GiB Total") || !strings.Contains(msg, "7 Online, 1 Offline") { + t.Fatal("Unexpected storage info message, found:", msg) } } diff --git a/cmd/xl-v1.go b/cmd/xl-v1.go index 069d662dc..ebfa36935 100644 --- a/cmd/xl-v1.go +++ b/cmd/xl-v1.go @@ -208,8 +208,8 @@ func getStorageInfo(disks []StorageAPI) StorageInfo { // Free as the total aggregated values. Total capacity is always // the multiple of smallest disk among the disk list. storageInfo := StorageInfo{ - Total: disksInfo[0].Total * int64(onlineDisks), - Free: disksInfo[0].Free * int64(onlineDisks), + Total: disksInfo[0].Total * int64(onlineDisks) / 2, + Free: disksInfo[0].Free * int64(onlineDisks) / 2, } storageInfo.Backend.Type = XL storageInfo.Backend.OnlineDisks = onlineDisks