Skip to content

Commit a8fce7c

Browse files
pcacjrsmfrench
authored andcommitted
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>
1 parent 855982a commit a8fce7c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

fs/smb/client/connect.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4238,8 +4238,10 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
42384238
struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&pserver->dstaddr;
42394239
struct sockaddr_in *addr = (struct sockaddr_in *)&pserver->dstaddr;
42404240
bool is_binding = false;
4241+
bool new_ses;
42414242

42424243
spin_lock(&ses->ses_lock);
4244+
new_ses = ses->ses_status == SES_NEW;
42434245
cifs_dbg(FYI, "%s: channel connect bitmap: 0x%lx\n",
42444246
__func__, ses->chans_need_reconnect);
42454247

@@ -4325,7 +4327,10 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
43254327
}
43264328

43274329
if (rc) {
4328-
cifs_server_dbg(VFS, "Send error in SessSetup = %d\n", rc);
4330+
if (new_ses) {
4331+
cifs_server_dbg(VFS, "failed to create a new SMB session with %s: %d\n",
4332+
get_security_type_str(ses->sectype), rc);
4333+
}
43294334
spin_lock(&ses->ses_lock);
43304335
if (ses->ses_status == SES_IN_SETUP)
43314336
ses->ses_status = SES_NEED_RECON;

0 commit comments

Comments
 (0)