aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
authorRemi Pommarel <repk@triplefau.lt>2026-05-21 11:40:31 +0200
committerDominique Martinet <asmadeus@codewreck.org>2026-05-29 02:16:40 +0000
commit64a0eb2b22245a881cdf245710eec2977a8a9e9c (patch)
treec682efffbcb62242229c0a218855048a2112ceb6 /fs
parent7025a34eda23ddedcb1c1d585b7bdc66586434f4 (diff)
downloadlinux-next-history-64a0eb2b22245a881cdf245710eec2977a8a9e9c.tar.gz
9p: Set default negative dentry retention time for cache=loose
For cache=loose mounts, set the default negative dentry cache retention time to 24 hours. Signed-off-by: Remi Pommarel <repk@triplefau.lt> Message-ID: <b5beca3e70890ab8a4f0b9e99bd69cb97f5cb9eb.1779355927.git.repk@triplefau.lt> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/9p/v9fs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index 3e758b66fefae..274c5157135da 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -24,6 +24,9 @@
#include "v9fs_vfs.h"
#include "cache.h"
+/* cache=loose default negative dentry retention time is 24hours */
+#define CACHE_LOOSE_NDENTRY_TIMEOUT_DEFAULT (24 * 60 * 60 * 1000)
+
static DEFINE_SPINLOCK(v9fs_sessionlist_lock);
static LIST_HEAD(v9fs_sessionlist);
struct kmem_cache *v9fs_inode_cache;
@@ -441,6 +444,13 @@ static void v9fs_apply_options(struct v9fs_session_info *v9ses,
v9ses->uid = ctx->session_opts.uid;
v9ses->session_lock_timeout = ctx->session_opts.session_lock_timeout;
v9ses->ndentry_timeout_ms = ctx->session_opts.ndentry_timeout_ms;
+
+ /* If negative dentry timeout has not been overridden set default for
+ * cache=loose
+ */
+ if (!(v9ses->flags & V9FS_NDENTRY_TIMEOUT_SET) &&
+ (v9ses->cache & CACHE_LOOSE))
+ v9ses->ndentry_timeout_ms = CACHE_LOOSE_NDENTRY_TIMEOUT_DEFAULT;
}
/**