xl/CreateFile: handle errFileNameTooLong error properly (#1523)

When errFileNameTooLong error is returned from posix, xl.CreateFile()
treats the error specially by returning the same error immediately.

Fixes #1501
This commit is contained in:
Bala FA
2016-05-12 01:25:02 +05:30
committed by Harshavardhana
parent 86e5d71519
commit adbcafefad
5 changed files with 88 additions and 0 deletions
+8
View File
@@ -105,6 +105,14 @@ func (xl XL) writeErasure(volume, path string, reader *io.PipeReader, wcloser *w
"volume": volume,
"path": path,
}).Errorf("CreateFile failed with %s", err)
// treat errFileNameTooLong specially
if err == errFileNameTooLong {
xl.cleanupCreateFileOps(volume, path, append(writers, metadataWriters...)...)
reader.CloseWithError(err)
return
}
createFileError++
// We can safely allow CreateFile errors up to len(xl.storageDisks) - xl.writeQuorum