1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 05:52:20 +08:00

fuse/ipns, fuse/readonly: Let the fuse library set defaults for Attr

Without this, all entries will have nlink==0, which confuses a bunch
of tools. Most dramatically, systemd-nspawn enters a busy loop in its
lock utility function.

License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
This commit is contained in:
Tommi Virtanen
2015-08-31 18:03:59 -07:00
committed by Jeromy
parent 1d21fad697
commit fbd9cabd93
3 changed files with 10 additions and 17 deletions

View File

@ -46,7 +46,7 @@ type Root struct {
// Attr returns file attributes.
func (*Root) Attr(ctx context.Context, a *fuse.Attr) error {
*a = fuse.Attr{Mode: os.ModeDir | 0111} // -rw+x
a.Mode = os.ModeDir | 0111 // -rw+x
return nil
}
@ -118,7 +118,6 @@ func (s *Node) Attr(ctx context.Context, a *fuse.Attr) error {
a.Size = uint64(len(s.cached.GetData()))
a.Uid = uint32(os.Getuid())
a.Gid = uint32(os.Getgid())
default:
return fmt.Errorf("Invalid data type - %s", s.cached.GetType())
}