Commit d12bc6d2 authored by Shyam Prasad N's avatar Shyam Prasad N Committed by Steve French

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: default avatarShyam Prasad N <sprasad@microsoft.com>
Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@manguebit.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 896cd316
...@@ -216,6 +216,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) ...@@ -216,6 +216,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
{ {
struct mid_q_entry *mid_entry; struct mid_q_entry *mid_entry;
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
struct TCP_Server_Info *chan_server;
struct cifs_ses *ses; struct cifs_ses *ses;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
struct cifs_server_iface *iface; struct cifs_server_iface *iface;
...@@ -474,23 +475,35 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) ...@@ -474,23 +475,35 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
seq_puts(m, "\t\t[CONNECTED]\n"); seq_puts(m, "\t\t[CONNECTED]\n");
} }
spin_unlock(&ses->iface_lock); spin_unlock(&ses->iface_lock);
}
if (i == 0)
seq_printf(m, "\n\t\t[NONE]");
seq_puts(m, "\n\n\tMIDs: "); seq_puts(m, "\n\n\tMIDs: ");
spin_lock(&server->mid_lock); spin_lock(&ses->chan_lock);
list_for_each_entry(mid_entry, &server->pending_mid_q, qhead) { for (j = 0; j < ses->chan_count; j++) {
seq_printf(m, "\n\tState: %d com: %d pid:" chan_server = ses->chans[j].server;
" %d cbdata: %p mid %llu\n", if (!chan_server)
continue;
if (list_empty(&chan_server->pending_mid_q))
continue;
seq_printf(m, "\n\tServer ConnectionId: 0x%llx",
chan_server->conn_id);
spin_lock(&chan_server->mid_lock);
list_for_each_entry(mid_entry, &chan_server->pending_mid_q, qhead) {
seq_printf(m, "\n\t\tState: %d com: %d pid: %d cbdata: %p mid %llu",
mid_entry->mid_state, mid_entry->mid_state,
le16_to_cpu(mid_entry->command), le16_to_cpu(mid_entry->command),
mid_entry->pid, mid_entry->pid,
mid_entry->callback_data, mid_entry->callback_data,
mid_entry->mid); mid_entry->mid);
} }
spin_unlock(&server->mid_lock); spin_unlock(&chan_server->mid_lock);
seq_printf(m, "\n--\n"); }
spin_unlock(&ses->chan_lock);
seq_puts(m, "\n--\n");
}
if (i == 0)
seq_printf(m, "\n\t\t[NONE]");
} }
if (c == 0) if (c == 0)
seq_printf(m, "\n\t[NONE]"); seq_printf(m, "\n\t[NONE]");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment