Skip to content
Open
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
1 change: 1 addition & 0 deletions core/cfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type FlagStorage struct {
NoPreloadDir bool
NoVerifySSL bool
WinRefreshDirs bool
NoEvictRootChilds bool

// Debugging
DebugMain bool
Expand Down
6 changes: 6 additions & 0 deletions core/cfg/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,11 @@ MISC OPTIONS:
Value: 512,
Usage: "Simultaneously opened cache file descriptor limit",
},
cli.BoolFlag{
Name: "no-evict-root-childs",
Usage: "Do not evict inode if it parent is RootInode." +
" Useful if you mount one bucket and docker mount the bucket's child folders.",
},
}

if runtime.GOOS == "windows" {
Expand Down Expand Up @@ -876,6 +881,7 @@ func PopulateFlags(c *cli.Context) (ret *FlagStorage) {
PreferPatchUploads: c.Bool("prefer-patch-uploads"),
NoPreloadDir: c.Bool("no-preload-dir"),
NoVerifySSL: c.Bool("no-verify-ssl"),
NoEvictRootChilds: c.Bool("no-evict-root-childs"),

// Common Backend Config
Endpoint: c.String("endpoint"),
Expand Down
7 changes: 7 additions & 0 deletions core/goofys.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,13 @@ func (fs *Goofys) EvictEntry(id fuseops.InodeID) bool {
childTmp.isDir() && atomic.LoadInt64(&childTmp.dir.ModifiedChildren) > 0 {
return false
}
// Do not evict inode if it parent is RootInode
if fs.flags.NoEvictRootChilds && childTmp.Parent.Id == fuseops.RootInodeID {
log.Debugf("Do not evict root child: inode %v, name %v, parent inode %v", childTmp.Id, childTmp.Name, childTmp.Parent.Id)
childNewExprTime := time.Now()
childTmp.SetExpireTime(childNewExprTime)
return false
}
if !childTmp.mu.TryLock() {
return false
}
Expand Down