Report correct error when O_DIRECT is not supported (#9545)

fixes #9537
This commit is contained in:
Harshavardhana
2020-05-07 16:12:16 -07:00
committed by GitHub
parent 0674c0075e
commit 2dc46cb153
7 changed files with 47 additions and 6 deletions
+5 -1
View File
@@ -131,8 +131,12 @@ func NewFSObjectLayer(fsPath string) (ObjectLayer, error) {
var err error
if fsPath, err = getValidPath(fsPath); err != nil {
if err == errMinDiskSize {
return nil, err
return nil, config.ErrUnableToWriteInBackend(err).Hint(err.Error())
} else if err == errUnsupportedDisk {
hint := fmt.Sprintf("'%s' does not support O_DIRECT flags, refusing to use", fsPath)
return nil, config.ErrUnsupportedBackend(err).Hint(hint)
}
// Show a descriptive error with a hint about how to fix it.
var username string
if u, err := user.Current(); err == nil {