Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions internal/backend_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (s *S3Backend) Init(key string) error {
}

func (s *S3Backend) ListObjectsV2(params *s3.ListObjectsV2Input) (*s3.ListObjectsV2Output, string, error) {
s3Log.Debugf("MATHIS TEST: params %v, backend %v", params, s)
s3Log.Debugf("ListObjectsV2: params %v, backend %v", params, s)
if s.aws {
req, resp := s.S3.ListObjectsV2Request(params)
err := req.Send()
Expand All @@ -317,7 +317,7 @@ func (s *S3Backend) ListObjectsV2(params *s3.ListObjectsV2Input) (*s3.ListObject
if err != nil {
return nil, "", err
}
s3Log.Debugf("MATHIS TEST: objs %v, err %v", objs, err)
s3Log.Debugf("ListObjectsV2: objs %v, err %v", objs, err)
count := int64(len(objs.Contents))
v2Objs := s3.ListObjectsV2Output{
CommonPrefixes: objs.CommonPrefixes,
Expand Down Expand Up @@ -392,7 +392,7 @@ func (s *S3Backend) HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error) {

func (s *S3Backend) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error) {
var maxKeys *int64
s3Log.Debugf("MATHIS TEST")
s3Log.Debugf("ListBlobs")
if param.MaxKeys != nil {
maxKeys = aws.Int64(int64(*param.MaxKeys))
}
Expand All @@ -405,7 +405,7 @@ func (s *S3Backend) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error) {
StartAfter: param.StartAfter,
ContinuationToken: param.ContinuationToken,
})
s3Log.Debugf("MATHIS TEST: resp %v, reqid %v, err %v", resp, reqId, err)
s3Log.Debugf("ListBlobs: resp %v, reqid %v, err %v", resp, reqId, err)
if err != nil {
return nil, mapAwsError(err)
}
Expand All @@ -425,12 +425,12 @@ func (s *S3Backend) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error) {
StorageClass: i.StorageClass,
})
}
s3Log.Debugf("MATHIS TEST: prefixes %v, items %v", prefixes, items)
s3Log.Debugf("ListBlobs: prefixes %v, items %v", prefixes, items)
isTruncatedFlag := false
if resp.IsTruncated != nil {
isTruncatedFlag = *resp.IsTruncated
} else {
s3Log.Debugf("MATHIS TEST: nil pointer catch")
s3Log.Debugf("ListBlobs: nil pointer catch")
}
return &ListBlobsOutput{
Prefixes: prefixes,
Expand Down
13 changes: 13 additions & 0 deletions internal/goofys.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,19 @@ func (fs *Goofys) ForgetInode(
fs.mu.Lock()
defer fs.mu.Unlock()

// Fix ReadDir inode leak
// https://github.com/kahing/goofys/pull/786
if inode.isDir() {
for _, child := range inode.dir.Children {
if *child.Name == "." || *child.Name == ".." {
continue
}
s3Log.Debugf("Goofys Upstream PR: Inode Dir Leak fix")
delete(fs.inodes, child.Id)
fs.forgotCnt += 1
}
}

delete(fs.inodes, op.Inode)
fs.forgotCnt += 1

Expand Down
Loading