Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respect the max quota when updating the space quota #3714

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/unreleased/quota.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Added a global max quota option to limit how much quota can be assigned to space
Added a max quota value in the spacescapabilities.
Added a quota parameter to CreateHome. This is a prerequisite for setting a default quota per usertypes.

https://github.com/cs3org/reva/pull/3714
https://github.com/cs3org/reva/pull/3682
https://github.com/cs3org/reva/pull/3678
https://github.com/cs3org/reva/pull/3671
3 changes: 3 additions & 0 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ func (fs *Decomposedfs) UpdateStorageSpace(ctx context.Context, req *provider.Up
return &provider.UpdateStorageSpaceResponse{
Status: &v1beta11.Status{Code: v1beta11.Code_CODE_INVALID_ARGUMENT, Message: "decompsedFS: requested quota is higher than allowed"},
}, nil
} else if fs.o.MaxQuota != quotaUnrestricted && space.Quota.QuotaMaxBytes == quotaUnrestricted {
// If the caller wants to unrestrict the space we give it the maximum allowed quota.
space.Quota.QuotaMaxBytes = fs.o.MaxQuota
}
metadata[prefixes.QuotaAttr] = strconv.FormatUint(space.Quota.QuotaMaxBytes, 10)
}
Expand Down