Skip to content

Commit

Permalink
fix dump trash nlink (#4561)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro authored Mar 24, 2024
1 parent 4fb1c98 commit 46090dd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/meta/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -3609,7 +3609,14 @@ func (m *dbMeta) dumpEntryFast(inode Ino, typ uint8) *DumpedEntry {
}

attr := &Attr{Typ: typ, Nlink: 1}
m.parseAttr(n, attr)
if !ok {
logger.Warnf("The entry of the inode was not found. inode: %d", inode)
if attr.Typ == TypeDirectory {
attr.Nlink = 2
}
} else {
m.parseAttr(n, attr)
}
e.Attr = &DumpedAttr{}
dumpAttr(attr, e.Attr)
e.Attr.Inode = inode
Expand Down

0 comments on commit 46090dd

Please sign in to comment.