mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
XL: return error if DeleteObject() fails. (#1878)
Previously DeleteObject() does not return any error if write quorum is not available. This patch fixes the issue by returning errors.
This commit is contained in:
parent
d32f3288f8
commit
d13e6e7156
@ -438,7 +438,7 @@ func (xl xlObjects) deleteObject(bucket, object string) error {
|
|||||||
// DeleteObject - deletes an object, this call doesn't necessary reply
|
// DeleteObject - deletes an object, this call doesn't necessary reply
|
||||||
// any error as it is not necessary for the handler to reply back a
|
// any error as it is not necessary for the handler to reply back a
|
||||||
// response to the client request.
|
// response to the client request.
|
||||||
func (xl xlObjects) DeleteObject(bucket, object string) error {
|
func (xl xlObjects) DeleteObject(bucket, object string) (err error) {
|
||||||
// Verify if bucket is valid.
|
// Verify if bucket is valid.
|
||||||
if !IsValidBucketName(bucket) {
|
if !IsValidBucketName(bucket) {
|
||||||
return BucketNameInvalid{Bucket: bucket}
|
return BucketNameInvalid{Bucket: bucket}
|
||||||
@ -448,6 +448,11 @@ func (xl xlObjects) DeleteObject(bucket, object string) error {
|
|||||||
}
|
}
|
||||||
nsMutex.Lock(bucket, object)
|
nsMutex.Lock(bucket, object)
|
||||||
defer nsMutex.Unlock(bucket, object)
|
defer nsMutex.Unlock(bucket, object)
|
||||||
xl.deleteObject(bucket, object)
|
|
||||||
return nil
|
if err = xl.deleteObject(bucket, object); err == errFileNotFound {
|
||||||
|
// Its valid to return success if given object is not found.
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user