Skip to content

Commit 8515092

Browse files
aaptelSteve French
authored andcommitted
cifs: dump channel info in DebugData
* show server&TCP states for extra channels * mention if an interface has a channel connected to it In this version three of the patch, fixed minor printk format issue pointed out by the kbuild robot. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Aurelien Aptel <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 1ae9a5a commit 8515092

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

fs/cifs/cifs_debug.c

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,27 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
121121
seq_putc(m, '\n');
122122
}
123123

124+
static void
125+
cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
126+
{
127+
struct TCP_Server_Info *server = chan->server;
128+
129+
seq_printf(m, "\t\tChannel %d Number of credits: %d Dialect 0x%x "
130+
"TCP status: %d Instance: %d Local Users To Server: %d "
131+
"SecMode: 0x%x Req On Wire: %d In Send: %d "
132+
"In MaxReq Wait: %d\n",
133+
i+1,
134+
server->credits,
135+
server->dialect,
136+
server->tcpStatus,
137+
server->reconnect_instance,
138+
server->srv_count,
139+
server->sec_mode,
140+
in_flight(server),
141+
atomic_read(&server->in_send),
142+
atomic_read(&server->num_waiters));
143+
}
144+
124145
static void
125146
cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
126147
{
@@ -376,6 +397,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
376397
if (ses->sign)
377398
seq_puts(m, " signed");
378399

400+
if (ses->chan_count > 1) {
401+
seq_printf(m, "\n\n\tExtra Channels: %zu\n",
402+
ses->chan_count-1);
403+
for (j = 1; j < ses->chan_count; j++)
404+
cifs_dump_channel(m, j, &ses->chans[j]);
405+
}
406+
379407
seq_puts(m, "\n\tShares:");
380408
j = 0;
381409

@@ -414,8 +442,13 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
414442
seq_printf(m, "\n\tServer interfaces: %zu\n",
415443
ses->iface_count);
416444
for (j = 0; j < ses->iface_count; j++) {
445+
struct cifs_server_iface *iface;
446+
447+
iface = &ses->iface_list[j];
417448
seq_printf(m, "\t%d)", j);
418-
cifs_dump_iface(m, &ses->iface_list[j]);
449+
cifs_dump_iface(m, iface);
450+
if (is_ses_using_iface(ses, iface))
451+
seq_puts(m, "\t\t[CONNECTED]\n");
419452
}
420453
spin_unlock(&ses->iface_lock);
421454
}

0 commit comments

Comments
 (0)