mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -05:00
XL: Handle object layer initialization properly.
Initialization when disk was down the network disk reported an incorrect error rather than errDiskNotFound. This resulted in incorrect error handling during prepInitStorage() stage. Fixes #2577
This commit is contained in:
@@ -18,6 +18,8 @@ package cmd
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net"
|
||||
"net/rpc"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -42,11 +44,19 @@ func toStorageErr(err error) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch err.(type) {
|
||||
case *net.OpError:
|
||||
return errDiskNotFound
|
||||
}
|
||||
|
||||
switch err.Error() {
|
||||
case io.EOF.Error():
|
||||
return io.EOF
|
||||
case io.ErrUnexpectedEOF.Error():
|
||||
return io.ErrUnexpectedEOF
|
||||
case rpc.ErrShutdown.Error():
|
||||
return errDiskNotFound
|
||||
case errUnexpected.Error():
|
||||
return errUnexpected
|
||||
case errDiskFull.Error():
|
||||
|
||||
Reference in New Issue
Block a user