Skip to content

Commit 7b38f6d

Browse files
author
Steve French
committed
smb3: display network namespace in debug information
We recently had problems where a network namespace was deleted causing hard to debug reconnect problems. To help deal with configuration issues like this it is useful to dump the network namespace to better debug what happened. So add this to information displayed in /proc/fs/cifs/DebugData for the server (and channels if mounted with multichannel). For example: Local Users To Server: 1 SecMode: 0x1 Req On Wire: 0 Net namespace: 4026531840 This can be easily compared with what is displayed for the processes on the system. For example /proc/1/ns/net in this case showed the same thing (see below), and we can see that the namespace is still valid in this example. 'net:[4026531840]' Cc: stable@vger.kernel.org Acked-by: Paulo Alcantara (SUSE) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 69513dd commit 7b38f6d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fs/smb/client/cifs_debug.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ cifs_dump_channel(struct seq_file *m, int i, struct cifs_chan *chan)
153153
in_flight(server),
154154
atomic_read(&server->in_send),
155155
atomic_read(&server->num_waiters));
156+
#ifdef CONFIG_NET_NS
157+
if (server->net)
158+
seq_printf(m, " Net namespace: %u ", server->net->ns.inum);
159+
#endif /* NET_NS */
160+
156161
}
157162

158163
static inline const char *smb_speed_to_str(size_t bps)
@@ -430,10 +435,15 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
430435
server->reconnect_instance,
431436
server->srv_count,
432437
server->sec_mode, in_flight(server));
438+
#ifdef CONFIG_NET_NS
439+
if (server->net)
440+
seq_printf(m, " Net namespace: %u ", server->net->ns.inum);
441+
#endif /* NET_NS */
433442

434443
seq_printf(m, "\nIn Send: %d In MaxReq Wait: %d",
435444
atomic_read(&server->in_send),
436445
atomic_read(&server->num_waiters));
446+
437447
if (server->leaf_fullpath) {
438448
seq_printf(m, "\nDFS leaf full path: %s",
439449
server->leaf_fullpath);

0 commit comments

Comments
 (0)