From 2c92dce07c2a9680b58d8b1ea82778b1dae46bdf Mon Sep 17 00:00:00 2001 From: zhijian Date: Fri, 9 Aug 2024 10:22:46 +0800 Subject: [PATCH] quota: fixed a bug where hardlink's quota update in the same directory was incorrect (#5069) --- pkg/meta/quota.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/meta/quota.go b/pkg/meta/quota.go index 38deae922273..3d5005d8debb 100644 --- a/pkg/meta/quota.go +++ b/pkg/meta/quota.go @@ -169,9 +169,9 @@ func (m *baseMeta) updateParentStat(ctx Context, inode, parent Ino, length, spac m.updateDirQuota(ctx, parent, space, 0) } else { go func() { - for p := range m.en.doGetParents(ctx, inode) { - m.updateDirStat(ctx, p, length, space, 0) - m.updateDirQuota(ctx, p, space, 0) + for p, v := range m.en.doGetParents(ctx, inode) { + m.updateDirStat(ctx, p, length*int64(v), space*int64(v), 0) + m.updateDirQuota(ctx, p, space*int64(v), 0) } }() }