XL/DeleteObject: delete call on a prefix should not delete the entire tree structure. (#1916)

fixes #1915
This commit is contained in:
Krishna Srinivas
2016-06-17 10:48:43 +05:30
committed by Harshavardhana
parent f51d34cedd
commit 365f80efa3
3 changed files with 34 additions and 6 deletions
+4
View File
@@ -446,6 +446,10 @@ func (xl xlObjects) DeleteObject(bucket, object string) (err error) {
nsMutex.Lock(bucket, object)
defer nsMutex.Unlock(bucket, object)
if !xl.isObject(bucket, object) {
return ObjectNotFound{bucket, object}
}
if err = xl.deleteObject(bucket, object); err == errFileNotFound {
// Its valid to return success if given object is not found.
err = nil