mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
Remove minimum inodes reqd check (#4747)
This commit is contained in:
@@ -34,9 +34,9 @@ const (
|
||||
// StorageInfo - represents total capacity of underlying storage.
|
||||
type StorageInfo struct {
|
||||
// Total disk space.
|
||||
Total int64
|
||||
Total uint64
|
||||
// Free available disk space.
|
||||
Free int64
|
||||
Free uint64
|
||||
// Backend type.
|
||||
Backend struct {
|
||||
// Represents various backend types, currently on FS and Erasure.
|
||||
|
||||
31
cmd/posix.go
31
cmd/posix.go
@@ -35,11 +35,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
diskMinFreeSpace = 1 * humanize.GiByte // Min 1GiB free space.
|
||||
diskMinTotalSpace = diskMinFreeSpace // Min 1GiB total space.
|
||||
diskMinFreeInodes = 10000 // Min 10000 free inodes.
|
||||
diskMinTotalInodes = diskMinFreeInodes // Min 10000 total inodes.
|
||||
maxAllowedIOError = 5
|
||||
diskMinFreeSpace = 1 * humanize.GiByte // Min 1GiB free space.
|
||||
diskMinTotalSpace = diskMinFreeSpace // Min 1GiB total space.
|
||||
maxAllowedIOError = 5
|
||||
)
|
||||
|
||||
// posix - implements StorageAPI interface.
|
||||
@@ -177,18 +175,6 @@ func checkDiskMinTotal(di disk.Info) (err error) {
|
||||
if int64(totalDiskSpace) <= diskMinTotalSpace {
|
||||
return errDiskFull
|
||||
}
|
||||
|
||||
// Some filesystems do not implement a way to provide total inodes available, instead
|
||||
// inodes are allocated based on available disk space. For example CephDISK, StoreNext CVDISK,
|
||||
// AzureFile driver. Allow for the available disk to be separately validated and we will
|
||||
// validate inodes only if total inodes are provided by the underlying filesystem.
|
||||
if di.Files != 0 && di.FSType != "NFS" {
|
||||
totalFiles := int64(di.Files)
|
||||
if totalFiles <= diskMinTotalInodes {
|
||||
return errDiskFull
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -200,17 +186,6 @@ func checkDiskMinFree(di disk.Info) error {
|
||||
return errDiskFull
|
||||
}
|
||||
|
||||
// Some filesystems do not implement a way to provide total inodes available, instead inodes
|
||||
// are allocated based on available disk space. For example CephDISK, StoreNext CVDISK, AzureFile driver.
|
||||
// Allow for the available disk to be separately validate and we will validate inodes only if
|
||||
// total inodes are provided by the underlying filesystem.
|
||||
if di.Files != 0 && di.FSType != "NFS" {
|
||||
availableFiles := int64(di.Ffree)
|
||||
if availableFiles <= diskMinFreeInodes {
|
||||
return errDiskFull
|
||||
}
|
||||
}
|
||||
|
||||
// Success.
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1686,14 +1686,14 @@ func TestCheckDiskTotalMin(t *testing.T) {
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
// Test 2 - when fstype is xfs and total inodes are small.
|
||||
// Test 2 - when fstype is xfs and total inodes are less than 10k.
|
||||
{
|
||||
diskInfo: disk.Info{
|
||||
Total: diskMinTotalSpace * 3,
|
||||
FSType: "XFS",
|
||||
Files: 9999,
|
||||
},
|
||||
err: errDiskFull,
|
||||
err: nil,
|
||||
},
|
||||
// Test 3 - when fstype is btrfs and total inodes is empty.
|
||||
{
|
||||
@@ -1737,7 +1737,7 @@ func TestCheckDiskFreeMin(t *testing.T) {
|
||||
},
|
||||
err: nil,
|
||||
},
|
||||
// Test 2 - when fstype is xfs and total inodes are small.
|
||||
// Test 2 - when fstype is xfs and total inodes are less than 10k.
|
||||
{
|
||||
diskInfo: disk.Info{
|
||||
Free: diskMinTotalSpace * 3,
|
||||
@@ -1745,7 +1745,7 @@ func TestCheckDiskFreeMin(t *testing.T) {
|
||||
Files: 9999,
|
||||
Ffree: 9999,
|
||||
},
|
||||
err: errDiskFull,
|
||||
err: nil,
|
||||
},
|
||||
// Test 3 - when fstype is btrfs and total inodes are empty.
|
||||
{
|
||||
|
||||
@@ -1594,8 +1594,9 @@ func TestWebObjectLayerFaultyDisks(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Failed %v", err)
|
||||
}
|
||||
if storageInfoReply.StorageInfo.Total != -1 || storageInfoReply.StorageInfo.Free != -1 {
|
||||
t.Fatalf("Should get negative values of Total and Free since disks are faulty ")
|
||||
// if Total size is 0 it indicates faulty disk.
|
||||
if storageInfoReply.StorageInfo.Total != 0 {
|
||||
t.Fatalf("Should get zero Total size since disks are faulty ")
|
||||
}
|
||||
|
||||
// Test authorization of Web.Download
|
||||
|
||||
@@ -231,10 +231,11 @@ func getStorageInfo(disks []StorageAPI) StorageInfo {
|
||||
|
||||
// Sort so that the first element is the smallest.
|
||||
validDisksInfo := sortValidDisksInfo(disksInfo)
|
||||
// If there are no valid disks, set total and free disks to 0
|
||||
if len(validDisksInfo) == 0 {
|
||||
return StorageInfo{
|
||||
Total: -1,
|
||||
Free: -1,
|
||||
Total: 0,
|
||||
Free: 0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,8 +243,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: validDisksInfo[0].Total * int64(onlineDisks) / 2,
|
||||
Free: validDisksInfo[0].Free * int64(onlineDisks) / 2,
|
||||
Total: validDisksInfo[0].Total * uint64(onlineDisks) / 2,
|
||||
Free: validDisksInfo[0].Free * uint64(onlineDisks) / 2,
|
||||
}
|
||||
|
||||
storageInfo.Backend.Type = Erasure
|
||||
|
||||
Reference in New Issue
Block a user