From ea76e720544d59757209cbb639c025a10baf0b60 Mon Sep 17 00:00:00 2001 From: Praveen raj Mani Date: Fri, 29 Jun 2018 00:31:05 +0530 Subject: [PATCH] Incorrect error message for insufficient volume fix (#6099) Reply back with appropriate error message when the server is spawn with volume of insufficient size (< 1GiB). Fixes #5993. --- cmd/fs-v1.go | 3 +++ cmd/posix.go | 2 +- cmd/posix_test.go | 2 +- cmd/storage-errors.go | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/fs-v1.go b/cmd/fs-v1.go index 8e7057c48..6519070ce 100644 --- a/cmd/fs-v1.go +++ b/cmd/fs-v1.go @@ -112,6 +112,9 @@ func NewFSObjectLayer(fsPath string) (ObjectLayer, error) { var err error if fsPath, err = getValidPath(fsPath); err != nil { + if err == errMinDiskSize { + return nil, err + } return nil, uiErrUnableToWriteInBackend(err) } diff --git a/cmd/posix.go b/cmd/posix.go index 60eb9a59b..17c68ddda 100644 --- a/cmd/posix.go +++ b/cmd/posix.go @@ -224,7 +224,7 @@ func checkDiskMinTotal(di disk.Info) (err error) { // used for journalling, inodes etc. totalDiskSpace := float64(di.Total) * 0.95 if int64(totalDiskSpace) <= diskMinTotalSpace { - return errDiskFull + return errMinDiskSize } return nil } diff --git a/cmd/posix_test.go b/cmd/posix_test.go index 03d0ec23e..f3f208cef 100644 --- a/cmd/posix_test.go +++ b/cmd/posix_test.go @@ -1948,7 +1948,7 @@ func TestCheckDiskTotalMin(t *testing.T) { FSType: "XFS", Files: 9999, }, - err: errDiskFull, + err: errMinDiskSize, }, } diff --git a/cmd/storage-errors.go b/cmd/storage-errors.go index f1ae19122..95ff92f3c 100644 --- a/cmd/storage-errors.go +++ b/cmd/storage-errors.go @@ -76,6 +76,9 @@ var errBitrotHashAlgoInvalid = errors.New("bit-rot hash algorithm is invalid") // errCrossDeviceLink - rename across devices not allowed. var errCrossDeviceLink = errors.New("Rename across devices not allowed, please fix your backend configuration") +// errMinDiskSize - cannot create volume or files when disk size is less than threshold. +var errMinDiskSize = errors.New("The disk size is less than the minimum threshold") + // hashMisMatchError - represents a bit-rot hash verification failure // error. type hashMismatchError struct {