smb3: do not display empty interface list
authorSteve French <stfrench@microsoft.com>
Fri, 15 Jun 2018 02:59:31 +0000 (21:59 -0500)
committerSteve French <stfrench@microsoft.com>
Fri, 15 Jun 2018 07:38:08 +0000 (02:38 -0500)
If server does not support listing interfaces then do not
display empty "Server interfaces" line to avoid confusing users.

Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Aurelien Aptel <aaptel@suse.com>
fs/cifs/cifs_debug.c

index e8db245194e773c2bc283bd37c67bd307c05ab4e..bfe99950581527bcc494acb6419436e6373aa923 100644 (file)
@@ -333,7 +333,9 @@ skip_rdma:
                        spin_unlock(&GlobalMid_Lock);
 
                        spin_lock(&ses->iface_lock);
-                       seq_printf(m, "\n\tServer interfaces: %zu\n", ses->iface_count);
+                       if (ses->iface_count)
+                               seq_printf(m, "\n\tServer interfaces: %zu\n",
+                                          ses->iface_count);
                        for (j = 0; j < ses->iface_count; j++) {
                                seq_printf(m, "\t%d)\n", j);
                                cifs_dump_iface(m, &ses->iface_list[j]);