fuse: Report fuse.Attr.Blocks correctly

Fixes #4239.
This commit is contained in:
greatroar
2023-03-07 22:12:08 +01:00
parent a7786c67f1
commit cb5694d136
5 changed files with 46 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ func (l *link) Attr(ctx context.Context, a *fuse.Attr) error {
a.Nlink = uint32(l.node.Links)
a.Size = uint64(len(l.node.LinkTarget))
a.Blocks = 1 + a.Size/blockSize
a.Blocks = (a.Size + blockSize - 1) / blockSize
return nil
}