Linux 6.6 SMB Client To Allow Adjusting Cache Time For Directory Contents
With Linux 6.6 the KSMBD server is no longer "experimental" while this new kernel on the SMB3 client side also brings a notable addition: the new "dir_cache_timeout" option to control the cache time for directory contents.
For directory leases the SMB3 client code with the Linux kernel will cache the directory contents for a period of 30 seconds. But with some users finding that cache duration too short, Linux 6.6 is allowing the SMB3 client to use a user-supplied cache length/time. The maximum amount of time directory entries are cached for can now be easily adjusted via the /sys/module/cifs/parameters/dir_cache_timeout sysfs file or via the "dir_cache_timeout" module parameter. The maximum length that can be supplied is about 18 hours (65,000 seconds) or setting the value to zero will disable directory entry caching.
This support for controlling the SMB3 directory caching timeout was sent in as part of the SMB3 client fixes that are merged for Linux 6.6.
For directory leases the SMB3 client code with the Linux kernel will cache the directory contents for a period of 30 seconds. But with some users finding that cache duration too short, Linux 6.6 is allowing the SMB3 client to use a user-supplied cache length/time. The maximum amount of time directory entries are cached for can now be easily adjusted via the /sys/module/cifs/parameters/dir_cache_timeout sysfs file or via the "dir_cache_timeout" module parameter. The maximum length that can be supplied is about 18 hours (65,000 seconds) or setting the value to zero will disable directory entry caching.
This support for controlling the SMB3 directory caching timeout was sent in as part of the SMB3 client fixes that are merged for Linux 6.6.
4 Comments