--- zzzz-none-000/linux-2.6.32.61/fs/cifs/connect.c 2013-06-10 09:43:48.000000000 +0000 +++ virian-300e-630/linux-2.6.32.61/fs/cifs/connect.c 2011-05-25 13:51:48.000000000 +0000 @@ -1588,29 +1588,17 @@ } static struct cifsSesInfo * -cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol) +cifs_find_smb_ses(struct TCP_Server_Info *server, char *username) { + struct list_head *tmp; struct cifsSesInfo *ses; write_lock(&cifs_tcp_ses_lock); - list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { - switch (server->secType) { - case Kerberos: - if (vol->linux_uid != ses->linux_uid) - continue; - break; - default: - /* anything else takes username/password */ - if (strncmp(ses->userName, vol->username, - MAX_USERNAME_SIZE)) - continue; - if (strlen(vol->username) != 0 && - ses->password != NULL && - strncmp(ses->password, - vol->password ? vol->password : "", - MAX_PASSWORD_SIZE)) - continue; - } + list_for_each(tmp, &server->smb_ses_list) { + ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list); + if (strncmp(ses->userName, username, MAX_USERNAME_SIZE)) + continue; + ++ses->ses_count; write_unlock(&cifs_tcp_ses_lock); return ses; @@ -2374,7 +2362,7 @@ goto out; } - pSesInfo = cifs_find_smb_ses(srvTcp, volume_info); + pSesInfo = cifs_find_smb_ses(srvTcp, volume_info->username); if (pSesInfo) { cFYI(1, ("Existing smb sess found (status=%d)", pSesInfo->status));