From 6f2656c23c6b2e1ed42ce3b8288042909f725b88 Mon Sep 17 00:00:00 2001 From: Martin Honermeyer Date: Sat, 15 Jan 2022 12:47:41 +0100 Subject: [PATCH] Do not try to get xattrs for the root inode Otherwise the path in the S3 request is empty, which is invalid. --- internal/goofys.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/goofys.go b/internal/goofys.go index b3321d4a..639bf3e9 100644 --- a/internal/goofys.go +++ b/internal/goofys.go @@ -34,8 +34,9 @@ import ( "github.com/jacobsa/fuse/fuseops" "github.com/jacobsa/fuse/fuseutil" - "github.com/sirupsen/logrus" "net/http" + + "github.com/sirupsen/logrus" ) // goofys is a Filey System written in Go. All the backend data is @@ -464,11 +465,17 @@ func (fs *Goofys) GetXattr(ctx context.Context, func (fs *Goofys) ListXattr(ctx context.Context, op *fuseops.ListXattrOp) (err error) { + var xattrs []string + fs.mu.RLock() inode := fs.getInodeOrDie(op.Inode) fs.mu.RUnlock() - xattrs, err := inode.ListXattr() + // Do not try to get xattrs for the root inode + // Otherwise the path in the S3 request is empty, which is invalid + if inode.Id != 1 { + xattrs, err = inode.ListXattr() + } ncopied := 0