mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
Add 5% cumulative reduction in total size of the disk
This is done due to filesystem holding additional metadata and inode space which is unaccounted for during min-free-disk calculation.
This commit is contained in:
@@ -171,7 +171,9 @@ func (fs Filesystem) CreateObject(bucket, object, expectedMD5Sum string, size in
|
||||
return ObjectMetadata{}, probe.NewError(err)
|
||||
}
|
||||
|
||||
if int64((float64(stfs.Free)/float64(stfs.Total))*100) <= fs.minFreeDisk {
|
||||
// Remove 5% from total space for cumulative disk space used for journalling, inodes etc.
|
||||
availableDiskSpace := (float64(stfs.Free) / (float64(stfs.Total) - (0.05 * float64(stfs.Total)))) * 100
|
||||
if int64(availableDiskSpace) <= fs.minFreeDisk {
|
||||
return ObjectMetadata{}, probe.NewError(RootPathFull{Path: fs.path})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user