Skip to content

Commit 9cfcd86

Browse files
bharathsm-mssmfrench
authored andcommitted
smb: client: show smb lease key in open_files output
Add the SMB lease key in /proc/fs/cifs/open_files for debugging purposes. Signed-off-by: Bharath SM <bharathsm@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 1fab1fa commit 9cfcd86

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

fs/smb/client/cifs_debug.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
249249
seq_puts(m, "# Format:\n");
250250
seq_puts(m, "# <tree id> <ses id> <persistent fid> <flags> <count> <pid> <uid>");
251251
#ifdef CONFIG_CIFS_DEBUG2
252-
seq_puts(m, " <filename> <lease> <mid>\n");
252+
seq_puts(m, " <filename> <lease> <lease-key> <mid>\n");
253253
#else
254-
seq_puts(m, " <filename> <lease>\n");
254+
seq_puts(m, " <filename> <lease> <lease-key>\n");
255255
#endif /* CIFS_DEBUG2 */
256256
spin_lock(&cifs_tcp_ses_lock);
257257
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)
274274

275275
/* Append lease/oplock caching state as RHW letters */
276276
inode = d_inode(cfile->dentry);
277+
cinode = NULL;
277278
n = 0;
278279
if (inode) {
279280
cinode = CIFS_I(inode);
@@ -291,6 +292,12 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
291292
else
292293
seq_puts(m, "NONE");
293294

295+
seq_puts(m, " ");
296+
if (cinode && cinode->lease_granted)
297+
seq_printf(m, "%pUl", cinode->lease_key);
298+
else
299+
seq_puts(m, "-");
300+
294301
#ifdef CONFIG_CIFS_DEBUG2
295302
seq_printf(m, " %llu", cfile->fid.mid);
296303
#endif /* CONFIG_CIFS_DEBUG2 */

0 commit comments

Comments
 (0)