Send the lower level error directly from GetDiskID() (#10095)

this is to detect situations of corruption disk
format etc errors quickly and keep the disk online
in such scenarios for requests to fail appropriately.
This commit is contained in:
Harshavardhana
2020-07-21 13:54:06 -07:00
committed by GitHub
parent e464a5bfbc
commit a880283593
6 changed files with 47 additions and 49 deletions

View File

@@ -509,7 +509,7 @@ func (s *xlStorage) GetDiskID() (string, error) {
if os.IsNotExist(err) {
_, err = os.Stat(s.diskPath)
if err == nil {
// Disk is present by missing `format.json`
// Disk is present but missing `format.json`
return "", errUnformattedDisk
}
if os.IsNotExist(err) {
@@ -2112,7 +2112,7 @@ func (s *xlStorage) RenameData(srcVolume, srcPath, dataDir, dstVolume, dstPath s
}
legacyDataPath := pathJoin(dstVolumeDir, dstPath, legacyDataDir)
// legacy data dir means its old content, honor system umask.
if err = os.Mkdir(legacyDataPath, 0777); err != nil {
if err = os.MkdirAll(legacyDataPath, 0777); err != nil {
if isSysErrIO(err) {
return errFaultyDisk
}
@@ -2133,10 +2133,10 @@ func (s *xlStorage) RenameData(srcVolume, srcPath, dataDir, dstVolume, dstPath s
}
return osErrToFileErr(err)
}
// Sync all the metadata operations once renames are done.
globalSync()
}
// Sync all the metadata operations once renames are done.
globalSync()
}
var oldDstDataPath string