···13681368 list_for_each(tmp, &cifs_tcp_ses_list) {13691369 server = list_entry(tmp, struct TCP_Server_Info,13701370 tcp_ses_list);13711371-13721371 /*13731372 * the demux thread can exit on its own while still in CifsNew13741373 * so don't accept any sockets in that state. Since the···1388138913891390 ++server->srv_count;13901391 write_unlock(&cifs_tcp_ses_lock);13921392+ cFYI(1, ("Existing tcp session with server found"));13911393 return server;13921394 }13931395 write_unlock(&cifs_tcp_ses_lock);···20762076 }2077207720782078 srvTcp = cifs_find_tcp_session(&addr);20792079- if (srvTcp) {20802080- cFYI(1, ("Existing tcp session with server found"));20812081- } else { /* create socket */20792079+ if (!srvTcp) { /* create socket */20822080 if (addr.sa_family == AF_INET6) {20832081 cFYI(1, ("attempting ipv6 connect"));20842082 /* BB should we allow ipv6 on port 139? */···22902292 cifs_put_smb_ses(pSesInfo);22912293 else22922294 cifs_put_tcp_session(srvTcp);22932293- } else {22942294- atomic_inc(&tcon->useCount);22952295- cifs_sb->tcon = tcon;22962296- tcon->ses = pSesInfo;22972297-22982298- /* do not care if following two calls succeed - informational */22992299- if (!tcon->ipc) {23002300- CIFSSMBQFSDeviceInfo(xid, tcon);23012301- CIFSSMBQFSAttributeInfo(xid, tcon);23022302- }23032303-23042304- /* tell server which Unix caps we support */23052305- if (tcon->ses->capabilities & CAP_UNIX)23062306- /* reset of caps checks mount to see if unix extensions23072307- disabled for just this mount */23082308- reset_cifs_unix_caps(xid, tcon, sb, &volume_info);23092309- else23102310- tcon->unix_ext = 0; /* server does not support them */23112311-23122312- /* convert forward to back slashes in prepath here if needed */23132313- if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) == 0)23142314- convert_delimiter(cifs_sb->prepath,23152315- CIFS_DIR_SEP(cifs_sb));23162316-23172317- if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) {23182318- cifs_sb->rsize = 1024 * 127;23192319- cFYI(DBG2,23202320- ("no very large read support, rsize now 127K"));23212321- }23222322- if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X))23232323- cifs_sb->wsize = min(cifs_sb->wsize,23242324- (tcon->ses->server->maxBuf -23252325- MAX_CIFS_HDR_SIZE));23262326- if (!(tcon->ses->capabilities & CAP_LARGE_READ_X))23272327- cifs_sb->rsize = min(cifs_sb->rsize,23282328- (tcon->ses->server->maxBuf -23292329- MAX_CIFS_HDR_SIZE));22952295+ goto out;23302296 }22972297+ atomic_inc(&tcon->useCount);22982298+ cifs_sb->tcon = tcon;22992299+ tcon->ses = pSesInfo;23002300+23012301+ /* do not care if following two calls succeed - informational */23022302+ if (!tcon->ipc) {23032303+ CIFSSMBQFSDeviceInfo(xid, tcon);23042304+ CIFSSMBQFSAttributeInfo(xid, tcon);23052305+ }23062306+23072307+ /* tell server which Unix caps we support */23082308+ if (tcon->ses->capabilities & CAP_UNIX)23092309+ /* reset of caps checks mount to see if unix extensions23102310+ disabled for just this mount */23112311+ reset_cifs_unix_caps(xid, tcon, sb, &volume_info);23122312+ else23132313+ tcon->unix_ext = 0; /* server does not support them */23142314+23152315+ /* convert forward to back slashes in prepath here if needed */23162316+ if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) == 0)23172317+ convert_delimiter(cifs_sb->prepath, CIFS_DIR_SEP(cifs_sb));23182318+23192319+ if ((tcon->unix_ext == 0) && (cifs_sb->rsize > (1024 * 127))) {23202320+ cifs_sb->rsize = 1024 * 127;23212321+ cFYI(DBG2, ("no very large read support, rsize now 127K"));23222322+ }23232323+ if (!(tcon->ses->capabilities & CAP_LARGE_WRITE_X))23242324+ cifs_sb->wsize = min(cifs_sb->wsize,23252325+ (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE));23262326+ if (!(tcon->ses->capabilities & CAP_LARGE_READ_X))23272327+ cifs_sb->rsize = min(cifs_sb->rsize,23282328+ (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE));2331232923322330 /* volume_info.password is freed above when existing session found23332331 (in which case it is not needed anymore) but when new sesion is created