Skip to content

Commit 7c299e3

Browse files
authored
Fix usedbytes -> usedlogicalbytes (#5084)
1 parent 84a2d22 commit 7c299e3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

changelog/unreleased/quota-logical.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bugfix: use logicalbytes instead of bytes
2+
3+
EOS gRPC used `usedbytes` instead of `usedlogicalbytes` for calculating quota, resulting in a wrong view
4+
5+
https://github.com/cs3org/reva/pull/5084

pkg/eosclient/eosgrpc/eosgrpc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ func (c *Client) GetQuota(ctx context.Context, username string, rootAuth eosclie
853853
log.Debug().Str("func", "GetQuota").Str("quotanode:", fmt.Sprintf("%d: %#v", i, resp.Quota.Quotanode[i])).Msg("")
854854

855855
qi.TotalBytes += max(uint64(resp.Quota.Quotanode[i].Maxlogicalbytes), 0)
856-
qi.UsedBytes += resp.Quota.Quotanode[i].Usedbytes
856+
qi.UsedBytes += resp.Quota.Quotanode[i].Usedlogicalbytes
857857

858858
qi.TotalInodes += max(uint64(resp.Quota.Quotanode[i].Maxfiles), 0)
859859
qi.UsedInodes += resp.Quota.Quotanode[i].Usedfiles

0 commit comments

Comments
 (0)