Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH 1/3] smb: client: show smb lease key in open_files output
@ 2025-10-30 17:01 Bharath SM
  2025-10-30 17:01 ` [PATCH 2/3] smb: client: show smb lease key in open_dirs output Bharath SM
  2025-10-30 17:01 ` [PATCH 3/3] smb: client: show directory lease state in /proc/fs/cifs/open_dirs Bharath SM
  0 siblings, 2 replies; 11+ messages in thread
From: Bharath SM @ 2025-10-30 17:01 UTC (permalink / raw)
  To: linux-cifs, sprasad, smfrench; +Cc: Bharath SM

Add the SMB lease key in /proc/fs/cifs/open_files for
debugging purposes.

Signed-off-by: Bharath SM <bharathsm@microsoft.com>
---
 fs/smb/client/cifs_debug.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c
index 1fb71d2d31b5..1383caa5a034 100644
--- a/fs/smb/client/cifs_debug.c
+++ b/fs/smb/client/cifs_debug.c
@@ -249,9 +249,9 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
 	seq_puts(m, "# Format:\n");
 	seq_puts(m, "# <tree id> <ses id> <persistent fid> <flags> <count> <pid> <uid>");
 #ifdef CONFIG_CIFS_DEBUG2
-	seq_puts(m, " <filename> <lease> <mid>\n");
+	seq_puts(m, " <filename> <lease> <lease-key> <mid>\n");
 #else
-	seq_puts(m, " <filename> <lease>\n");
+	seq_puts(m, " <filename> <lease> <lease-key>\n");
 #endif /* CIFS_DEBUG2 */
 	spin_lock(&cifs_tcp_ses_lock);
 	list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
@@ -274,6 +274,7 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
 
 					/* Append lease/oplock caching state as RHW letters */
 					inode = d_inode(cfile->dentry);
+					cinode = NULL;
 					n = 0;
 					if (inode) {
 						cinode = CIFS_I(inode);
@@ -291,6 +292,12 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
 					else
 						seq_puts(m, "NONE");
 
+					seq_puts(m, " ");
+					if (cinode && cinode->lease_granted)
+						seq_printf(m, "%pUl", cinode->lease_key);
+					else
+						seq_puts(m, "-");
+
 #ifdef CONFIG_CIFS_DEBUG2
 					seq_printf(m, " %llu", cfile->fid.mid);
 #endif /* CONFIG_CIFS_DEBUG2 */
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-10-31 17:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 17:01 [PATCH 1/3] smb: client: show smb lease key in open_files output Bharath SM
2025-10-30 17:01 ` [PATCH 2/3] smb: client: show smb lease key in open_dirs output Bharath SM
2025-10-30 17:01 ` [PATCH 3/3] smb: client: show directory lease state in /proc/fs/cifs/open_dirs Bharath SM
2025-10-30 21:56   ` Paulo Alcantara
2025-10-30 22:08     ` Enzo Matsumiya
2025-10-30 22:14       ` Paulo Alcantara
2025-10-31  3:18       ` Shyam Prasad N
2025-10-31 12:55         ` Enzo Matsumiya
2025-10-31 17:32           ` Steve French
2025-10-31  3:19     ` Shyam Prasad N
2025-10-31  7:31       ` Bharath SM

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox