Skip to content

Commit

Permalink
fix(decomposedfs): fix quota calculation
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Oct 28, 2024
1 parent dd9fa42 commit 2f8d82f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-quota-calculation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix quota calculation

Quota would show "exceeded" when remaining quota was 0 because total was 0.

https://github.com/cs3org/reva/pull/4902
5 changes: 4 additions & 1 deletion pkg/storage/utils/decomposedfs/decomposedfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"context"
"fmt"
"io"
"math"
"net/url"
"path"
"path/filepath"
Expand Down Expand Up @@ -603,7 +604,9 @@ func (fs *Decomposedfs) GetQuota(ctx context.Context, ref *provider.Reference) (

func (fs *Decomposedfs) calculateTotalUsedRemaining(quotaStr string, inUse uint64) (uint64, uint64, uint64, error) {
var err error
var total, remaining uint64
var total uint64

remaining := uint64(math.MaxUint64)
switch quotaStr {
case node.QuotaUncalculated, node.QuotaUnknown:
// best we can do is return current total
Expand Down

0 comments on commit 2f8d82f

Please sign in to comment.