Linux 6.6 SMB Client To Allow Adjusting Cache Time For Directory Contents

Written by Michael Larabel in Linux Storage on 10 September 2023 at 11:00 AM EDT. 4 Comments
LINUX STORAGE
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.

dir_cache_timeout parameter text


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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week