From 205189f28f0688add7ae77c0391e4d18b89cf35e Mon Sep 17 00:00:00 2001 From: zhijian Date: Thu, 8 Aug 2024 16:25:49 +0800 Subject: [PATCH] quota: fix a bug where hardlink's quota update in the same directory was incorrect --- 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) } }() }