Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

smb: client: improve error message when creating SMB session

When failing to create a new SMB session with 'sec=krb5' for example,
the following error message isn't very useful

CIFS: VFS: \\srv Send error in SessSetup = -126

Improve it by printing the following instead on dmesg

CIFS: VFS: \\srv failed to create a new SMB session with Kerberos: -126

Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Cc: Pierguido Lambri <plambri@redhat.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: linux-cifs@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Paulo Alcantara and committed by
Steve French
a8fce7c8 855982a5

+6 -1
+6 -1
fs/smb/client/connect.c
··· 4238 4238 struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&pserver->dstaddr; 4239 4239 struct sockaddr_in *addr = (struct sockaddr_in *)&pserver->dstaddr; 4240 4240 bool is_binding = false; 4241 + bool new_ses; 4241 4242 4242 4243 spin_lock(&ses->ses_lock); 4244 + new_ses = ses->ses_status == SES_NEW; 4243 4245 cifs_dbg(FYI, "%s: channel connect bitmap: 0x%lx\n", 4244 4246 __func__, ses->chans_need_reconnect); 4245 4247 ··· 4327 4325 } 4328 4326 4329 4327 if (rc) { 4330 - cifs_server_dbg(VFS, "Send error in SessSetup = %d\n", rc); 4328 + if (new_ses) { 4329 + cifs_server_dbg(VFS, "failed to create a new SMB session with %s: %d\n", 4330 + get_security_type_str(ses->sectype), rc); 4331 + } 4331 4332 spin_lock(&ses->ses_lock); 4332 4333 if (ses->ses_status == SES_IN_SETUP) 4333 4334 ses->ses_status = SES_NEED_RECON;