summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@cjr.nz>2022-12-16 22:03:41 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-07 12:07:37 +0100
commit0f4dfff7dc7df794b8e8b93a84330a5cbaf62b37 (patch)
tree2047cba1e03b1d1534943dc10e1579d88c0c16d6
parent0588b12c418c3e4f927ced11f27b02ef4a5bfb07 (diff)
downloadlinux-stable-0f4dfff7dc7df794b8e8b93a84330a5cbaf62b37.tar.gz
linux-stable-0f4dfff7dc7df794b8e8b93a84330a5cbaf62b37.tar.bz2
linux-stable-0f4dfff7dc7df794b8e8b93a84330a5cbaf62b37.zip
cifs: fix confusing debug message
commit a85ceafd41927e41a4103d228a993df7edd8823b upstream. 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) <pc@cjr.nz> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/cifs/connect.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index a4a76f1d275c..3d71b37073ce 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2599,7 +2599,7 @@ cifs_set_cifscreds(struct smb_vol *vol __attribute__((unused)),
static struct cifs_ses *
cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
{
- int rc = -ENOMEM;
+ int rc = 0;
unsigned int xid;
struct cifs_ses *ses;
struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr;
@@ -2641,6 +2641,8 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
return ses;
}
+ rc = -ENOMEM;
+
cifs_dbg(FYI, "Existing smb sess not found\n");
ses = sesInfoAlloc();
if (ses == NULL)