Skip to content

Commit

Permalink
set max quota as space quota (#3682)
Browse files Browse the repository at this point in the history
When CreateStorageSpace is called without a quota but a max quota was set then the space can at most have max quota.
  • Loading branch information
David Christofas authored Mar 1, 2023
1 parent 1efcdab commit 387fb09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/quota.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ 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/3682
https://github.com/cs3org/reva/pull/3678
https://github.com/cs3org/reva/pull/3671
4 changes: 4 additions & 0 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (fs *Decomposedfs) CreateStorageSpace(ctx context.Context, req *provider.Cr
return nil, errtypes.BadRequest("decompsedFS: requested quota is higher than allowed")
}
metadata[prefixes.QuotaAttr] = strconv.FormatUint(q.QuotaMaxBytes, 10)
} else if fs.o.MaxQuota != quotaUnrestricted {
// If no quota was requested but a max quota was set then the the storage space has a quota
// of max quota.
metadata[prefixes.QuotaAttr] = strconv.FormatUint(fs.o.MaxQuota, 10)
}

if description != "" {
Expand Down

0 comments on commit 387fb09

Please sign in to comment.