Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96313
b: refs/heads/master
c: dea570e
h: refs/heads/master
i:
  96311: 7a4751a
v: v3
  • Loading branch information
Steve French committed May 6, 2008
1 parent 0a4c035 commit 7e21bdb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a815752ac0ffdb910e92958d41d28f4fb28e5296
refs/heads/master: dea570e08a69b14808b2cab56d6b0dda72145fa6
64 changes: 31 additions & 33 deletions trunk/fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,45 +1362,43 @@ find_unc(__be32 new_target_ip_addr, char *uncName, char *userName)
{
struct list_head *tmp;
struct cifsTconInfo *tcon;
__be32 old_ip;

read_lock(&GlobalSMBSeslock);

list_for_each(tmp, &GlobalTreeConnectionList) {
cFYI(1, ("Next tcon"));
tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
if (tcon->ses) {
if (tcon->ses->server) {
cFYI(1,
("old ip addr: %x == new ip %x ?",
tcon->ses->server->addr.sockAddr.sin_addr.
s_addr, new_target_ip_addr));
if (tcon->ses->server->addr.sockAddr.sin_addr.
s_addr == new_target_ip_addr) {
/* BB lock tcon, server and tcp session and increment use count here? */
/* found a match on the TCP session */
/* BB check if reconnection needed */
cFYI(1,
("IP match, old UNC: %s new: %s",
tcon->treeName, uncName));
if (strncmp
(tcon->treeName, uncName,
MAX_TREE_SIZE) == 0) {
cFYI(1,
("and old usr: %s new: %s",
tcon->treeName, uncName));
if (strncmp
(tcon->ses->userName,
userName,
MAX_USERNAME_SIZE) == 0) {
read_unlock(&GlobalSMBSeslock);
/* matched smb session
(user name */
return tcon;
}
}
}
}
}
if (!tcon->ses || !tcon->ses->server)
continue;

old_ip = tcon->ses->server->addr.sockAddr.sin_addr.s_addr;
cFYI(1, ("old ip addr: %x == new ip %x ?",
old_ip, new_target_ip_addr));

if (old_ip != new_target_ip_addr)
continue;

/* BB lock tcon, server, tcp session and increment use count? */
/* found a match on the TCP session */
/* BB check if reconnection needed */
cFYI(1, ("IP match, old UNC: %s new: %s",
tcon->treeName, uncName));

if (strncmp(tcon->treeName, uncName, MAX_TREE_SIZE))
continue;

cFYI(1, ("and old usr: %s new: %s",
tcon->treeName, uncName));

if (strncmp(tcon->ses->userName, userName, MAX_USERNAME_SIZE))
continue;

/* matched smb session (user name) */
read_unlock(&GlobalSMBSeslock);
return tcon;
}

read_unlock(&GlobalSMBSeslock);
return NULL;
}
Expand Down

0 comments on commit 7e21bdb

Please sign in to comment.