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