Skip to content

Commit

Permalink
Add warning if readdir cache has un-meet requirement
Browse files Browse the repository at this point in the history
Signed-off-by: Changxin Miao <[email protected]>
  • Loading branch information
polyrabbit committed Dec 31, 2024
1 parent 43e878f commit e104585
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/mount_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,15 @@ func mountMain(v *vfs.VFS, c *cli.Context) {
conf.EntryTimeout = utils.Duration(c.String("entry-cache"))
conf.DirEntryTimeout = utils.Duration(c.String("dir-entry-cache"))
conf.ReaddirCache = c.Bool("readdir-cache")
if conf.ReaddirCache {
if conf.AttrTimeout == 0 {
logger.Warnf("readdir-cache is enabled without attr-cache, it's performance may be affected")
}
major, minor := utils.GetKernelVersion()
if major < 4 || (major == 4 && minor < 20) {
logger.Warnf("readdir-cache requires kernel version 4.20 or higher, current version: %d.%d", major, minor)
}
}
conf.NonDefaultPermission = c.Bool("non-default-permission")
rootSquash := c.String("root-squash")
if rootSquash != "" {
Expand Down

0 comments on commit e104585

Please sign in to comment.