Skip to content

Commit a85ceaf

Browse files
Paulo Alcantarasmfrench
authored andcommitted
cifs: fix confusing debug message
Since rc was initialised to -ENOMEM in cifs_get_smb_ses(), when an existing smb session was found, free_xid() would be called and then print CIFS: fs/cifs/connect.c: Existing tcp session with server found CIFS: fs/cifs/connect.c: VFS: in cifs_get_smb_ses as Xid: 44 with uid: 0 CIFS: fs/cifs/connect.c: Existing smb sess found (status=1) CIFS: fs/cifs/connect.c: VFS: leaving cifs_get_smb_ses (xid = 44) rc = -12 Fix this by initialising rc to 0 and then let free_xid() print this instead CIFS: fs/cifs/connect.c: Existing tcp session with server found CIFS: fs/cifs/connect.c: VFS: in cifs_get_smb_ses as Xid: 14 with uid: 0 CIFS: fs/cifs/connect.c: Existing smb sess found (status=1) CIFS: fs/cifs/connect.c: VFS: leaving cifs_get_smb_ses (xid = 14) rc = 0 Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Cc: [email protected] Signed-off-by: Steve French <[email protected]>
1 parent 1d04a6f commit a85ceaf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/cifs/connect.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,7 @@ cifs_set_cifscreds(struct smb3_fs_context *ctx __attribute__((unused)),
21422142
struct cifs_ses *
21432143
cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
21442144
{
2145-
int rc = -ENOMEM;
2145+
int rc = 0;
21462146
unsigned int xid;
21472147
struct cifs_ses *ses;
21482148
struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr;
@@ -2191,6 +2191,8 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb3_fs_context *ctx)
21912191
return ses;
21922192
}
21932193

2194+
rc = -ENOMEM;
2195+
21942196
cifs_dbg(FYI, "Existing smb sess not found\n");
21952197
ses = sesInfoAlloc();
21962198
if (ses == NULL)

0 commit comments

Comments
 (0)