From 82a3fee58fd4e1632e5a2fa7206c47741da67dc9 Mon Sep 17 00:00:00 2001 From: Enzo Matsumiya Date: Fri, 2 May 2025 16:19:37 -0300 Subject: smb: client: show cached dirs in DebugData Signed-off-by: Enzo Matsumiya --- fs/smb/client/cifs_debug.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index e03c890de0a0..6314e20f4a53 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -26,6 +26,7 @@ #include "smbdirect.h" #endif #include "cifs_swn.h" +#include "cached_dir.h" void cifs_dump_mem(char *label, void *data, int length) @@ -129,6 +130,21 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon) seq_printf(m, "\n\tDFS origin fullpath: %s", tcon->origin_fullpath); } + if (tcon->cfids) { + struct cached_fid *cfid; + + seq_puts(m, "\n\tCached dirs:"); + list_for_each_entry(cfid, &tcon->cfids->entries, entry) { + const char *path = cfid->path; + + if (path && !*path) + /* this is just representative */ + path = "\\"; + + seq_printf(m, "\n\t\tpath=%s, has_lease=%s, open=%s", path, str_yes_no(cfid->has_lease), str_yes_no(cfid->is_open)); + } + seq_puts(m, "\n"); + } spin_unlock(&tcon->tc_lock); seq_putc(m, '\n'); } -- cgit v1.2.3