posix: Return errDiskNotWritable during disk initialization. (#2048)

It can happen that minio server might not have
writable permissions on the export paths command line.

Fixes #2035
This commit is contained in:
Harshavardhana
2016-07-02 01:59:28 -07:00
committed by Anand Babu (AB) Periasamy
parent e5dd917c37
commit d64c3fd464
9 changed files with 131 additions and 27 deletions
+8 -3
View File
@@ -122,9 +122,6 @@ func newXLObjects(disks []string) (ObjectLayer, error) {
}
}
// Runs house keeping code, like creating minioMetaBucket, cleaning up tmp files etc.
xlHouseKeeping(storageDisks)
// Attempt to load all `format.json`.
formatConfigs, sErrs := loadAllFormats(storageDisks)
@@ -138,6 +135,9 @@ func newXLObjects(disks []string) (ObjectLayer, error) {
// Handles different cases properly.
switch reduceFormatErrs(sErrs, len(storageDisks)) {
case errUnformattedDisk:
if err := initMetaVolume(storageDisks); err != nil {
return nil, fmt.Errorf("Unable to initialize '.minio' meta volume, %s", err)
}
// All drives online but fresh, initialize format.
if err := initFormatXL(storageDisks); err != nil {
return nil, fmt.Errorf("Unable to initialize format, %s", err)
@@ -153,6 +153,11 @@ func newXLObjects(disks []string) (ObjectLayer, error) {
// FIXME.
}
// Runs house keeping code, like t, cleaning up tmp files etc.
if err := xlHouseKeeping(storageDisks); err != nil {
return nil, err
}
// Load saved XL format.json and validate.
newPosixDisks, err := loadFormatXL(storageDisks)
if err != nil {