@ -332,7 +332,7 @@ func (cfs *cacheFSObjects) PutObject(ctx context.Context, bucket string, object
if isObjectDir ( object , data . Size ( ) ) {
if isObjectDir ( object , data . Size ( ) ) {
// Check if an object is present as one of the parent dir.
// Check if an object is present as one of the parent dir.
if fs . parentDirIsObject ( ctx , bucket , path . Dir ( object ) ) {
if fs . parentDirIsObject ( ctx , bucket , path . Dir ( object ) ) {
return ObjectInfo { } , toObjectErr ( errFileAccessDenied , bucket , object )
return ObjectInfo { } , toObjectErr ( errFileParentIsFile , bucket , object )
}
}
if err = mkdirAll ( pathJoin ( fs . fsPath , bucket , object ) , 0777 ) ; err != nil {
if err = mkdirAll ( pathJoin ( fs . fsPath , bucket , object ) , 0777 ) ; err != nil {
return ObjectInfo { } , toObjectErr ( err , bucket , object )
return ObjectInfo { } , toObjectErr ( err , bucket , object )
@ -350,7 +350,7 @@ func (cfs *cacheFSObjects) PutObject(ctx context.Context, bucket string, object
// Check if an object is present as one of the parent dir.
// Check if an object is present as one of the parent dir.
if fs . parentDirIsObject ( ctx , bucket , path . Dir ( object ) ) {
if fs . parentDirIsObject ( ctx , bucket , path . Dir ( object ) ) {
return ObjectInfo { } , toObjectErr ( errFileAccessDenied , bucket , object )
return ObjectInfo { } , toObjectErr ( errFileParentIsFile , bucket , object )
}
}
// Validate input data size and it can never be less than zero.
// Validate input data size and it can never be less than zero.