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

View File

@@ -58,6 +58,13 @@ func toObjectErr(err error, params ...string) error {
Object: params[1],
}
}
case errFileNameTooLong:
if len(params) >= 2 {
return ObjectNameInvalid{
Bucket: params[0],
Object: params[1],
}
}
case io.ErrUnexpectedEOF, io.ErrShortWrite:
return IncompleteBody{}
}