Skip to content

Commit

Permalink
Remove one unnecessary GetAttr when deleting from trash
Browse files Browse the repository at this point in the history
Signed-off-by: Changxin Miao <[email protected]>
  • Loading branch information
polyrabbit committed Feb 11, 2025
1 parent ab17da2 commit 39a21d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/meta/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ func (m *baseMeta) Unlink(ctx Context, parent Ino, name string, skipCheckTrash .
parent = m.checkRoot(parent)
var attr Attr
err := m.en.doUnlink(ctx, parent, name, &attr, skipCheckTrash...)
if err == 0 {
if err == 0 && !parent.IsTrash() {
var diffLength uint64
if attr.Typ == TypeFile {
diffLength = attr.Length
Expand Down

0 comments on commit 39a21d0

Please sign in to comment.