Skip to content

Commit d12bc6d

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: dump pending mids for all channels in DebugData
Currently, we only dump the pending mid information only on the primary channel in /proc/fs/cifs/DebugData. If multichannel is active, we do not print the pending MID list on secondary channels. This change will dump the pending mids for all the channels based on server->conn_id. Signed-off-by: Shyam Prasad N <[email protected]> Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 896cd31 commit d12bc6d

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

fs/cifs/cifs_debug.c

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
216216
{
217217
struct mid_q_entry *mid_entry;
218218
struct TCP_Server_Info *server;
219+
struct TCP_Server_Info *chan_server;
219220
struct cifs_ses *ses;
220221
struct cifs_tcon *tcon;
221222
struct cifs_server_iface *iface;
@@ -474,23 +475,35 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
474475
seq_puts(m, "\t\t[CONNECTED]\n");
475476
}
476477
spin_unlock(&ses->iface_lock);
478+
479+
seq_puts(m, "\n\n\tMIDs: ");
480+
spin_lock(&ses->chan_lock);
481+
for (j = 0; j < ses->chan_count; j++) {
482+
chan_server = ses->chans[j].server;
483+
if (!chan_server)
484+
continue;
485+
486+
if (list_empty(&chan_server->pending_mid_q))
487+
continue;
488+
489+
seq_printf(m, "\n\tServer ConnectionId: 0x%llx",
490+
chan_server->conn_id);
491+
spin_lock(&chan_server->mid_lock);
492+
list_for_each_entry(mid_entry, &chan_server->pending_mid_q, qhead) {
493+
seq_printf(m, "\n\t\tState: %d com: %d pid: %d cbdata: %p mid %llu",
494+
mid_entry->mid_state,
495+
le16_to_cpu(mid_entry->command),
496+
mid_entry->pid,
497+
mid_entry->callback_data,
498+
mid_entry->mid);
499+
}
500+
spin_unlock(&chan_server->mid_lock);
501+
}
502+
spin_unlock(&ses->chan_lock);
503+
seq_puts(m, "\n--\n");
477504
}
478505
if (i == 0)
479506
seq_printf(m, "\n\t\t[NONE]");
480-
481-
seq_puts(m, "\n\n\tMIDs: ");
482-
spin_lock(&server->mid_lock);
483-
list_for_each_entry(mid_entry, &server->pending_mid_q, qhead) {
484-
seq_printf(m, "\n\tState: %d com: %d pid:"
485-
" %d cbdata: %p mid %llu\n",
486-
mid_entry->mid_state,
487-
le16_to_cpu(mid_entry->command),
488-
mid_entry->pid,
489-
mid_entry->callback_data,
490-
mid_entry->mid);
491-
}
492-
spin_unlock(&server->mid_lock);
493-
seq_printf(m, "\n--\n");
494507
}
495508
if (c == 0)
496509
seq_printf(m, "\n\t[NONE]");

0 commit comments

Comments
 (0)