mirror of
https://github.com/versity/versitygw.git
synced 2026-10-22 06:12:39 +00:00
Merge pull request #2524 from versity/sis/cmu-upload-dir-quota-error
fix: map quota and no-space errors when creating the multipart upload directory
This commit is contained in:
@@ -2115,6 +2115,12 @@ func (p *Posix) CreateMultipartUpload(ctx context.Context, mpu s3response.Create
|
||||
// associated with this specific multipart upload
|
||||
err = os.MkdirAll(filepath.Join(tmppath, uploadID), p.newDirPerm)
|
||||
if err != nil {
|
||||
if errors.Is(err, syscall.EDQUOT) {
|
||||
return s3response.InitiateMultipartUploadResult{}, s3err.GetAPIError(s3err.ErrQuotaExceeded)
|
||||
}
|
||||
if errors.Is(err, syscall.ENOSPC) {
|
||||
return s3response.InitiateMultipartUploadResult{}, s3err.GetAPIError(s3err.ErrNoSpaceLeftOnDevice)
|
||||
}
|
||||
return s3response.InitiateMultipartUploadResult{}, fmt.Errorf("create upload temp dir: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user