diff options
author | Steve French <sfrench@us.ibm.com> | 2006-08-15 09:07:18 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-08-15 09:07:18 -0400 |
commit | e466e4876bf39474e15d0572f2204578137ae7f5 (patch) | |
tree | 1cefd7b97eb2d32846cffb5f8a32173e5db65946 | |
parent | 66abda5e1fa48e12e06d0b68746b0e67202a97d2 (diff) |
[CIFS] Fix oops in cifs_close due to unitialized lock sem and list in
new POSIX locking code
Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r-- | fs/cifs/CHANGES | 5 | ||||
-rw-r--r-- | fs/cifs/connect.c | 14 | ||||
-rw-r--r-- | fs/cifs/dir.c | 4 |
3 files changed, 16 insertions, 7 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index acb843b9bc3b..bd37727526ea 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -2,7 +2,10 @@ Version 1.45 | |||
2 | ------------ | 2 | ------------ |
3 | Do not time out lockw calls when using posix extensions. Do not | 3 | Do not time out lockw calls when using posix extensions. Do not |
4 | time out requests if server still responding reasonably fast | 4 | time out requests if server still responding reasonably fast |
5 | on requests on other threads | 5 | on requests on other threads. Improve POSIX locking emulation, |
6 | (lock cancel now works, and unlock of merged range works even | ||
7 | to Windows servers now). Fix oops on mount to lanman servers | ||
8 | (win9x, os/2 etc.) when null password. | ||
6 | 9 | ||
7 | Version 1.44 | 10 | Version 1.44 |
8 | ------------ | 11 | ------------ |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index b706b4f48b10..5d394c726860 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1271,33 +1271,35 @@ find_unc(__be32 new_target_ip_addr, char *uncName, char *userName) | |||
1271 | 1271 | ||
1272 | read_lock(&GlobalSMBSeslock); | 1272 | read_lock(&GlobalSMBSeslock); |
1273 | list_for_each(tmp, &GlobalTreeConnectionList) { | 1273 | list_for_each(tmp, &GlobalTreeConnectionList) { |
1274 | cFYI(1, ("Next tcon - ")); | 1274 | cFYI(1, ("Next tcon")); |
1275 | tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); | 1275 | tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); |
1276 | if (tcon->ses) { | 1276 | if (tcon->ses) { |
1277 | if (tcon->ses->server) { | 1277 | if (tcon->ses->server) { |
1278 | cFYI(1, | 1278 | cFYI(1, |
1279 | (" old ip addr: %x == new ip %x ?", | 1279 | ("old ip addr: %x == new ip %x ?", |
1280 | tcon->ses->server->addr.sockAddr.sin_addr. | 1280 | tcon->ses->server->addr.sockAddr.sin_addr. |
1281 | s_addr, new_target_ip_addr)); | 1281 | s_addr, new_target_ip_addr)); |
1282 | if (tcon->ses->server->addr.sockAddr.sin_addr. | 1282 | if (tcon->ses->server->addr.sockAddr.sin_addr. |
1283 | s_addr == new_target_ip_addr) { | 1283 | s_addr == new_target_ip_addr) { |
1284 | /* BB lock tcon and server and tcp session and increment use count here? */ | 1284 | /* BB lock tcon, server and tcp session and increment use count here? */ |
1285 | /* found a match on the TCP session */ | 1285 | /* found a match on the TCP session */ |
1286 | /* BB check if reconnection needed */ | 1286 | /* BB check if reconnection needed */ |
1287 | cFYI(1,("Matched ip, old UNC: %s == new: %s ?", | 1287 | cFYI(1,("IP match, old UNC: %s new: %s", |
1288 | tcon->treeName, uncName)); | 1288 | tcon->treeName, uncName)); |
1289 | if (strncmp | 1289 | if (strncmp |
1290 | (tcon->treeName, uncName, | 1290 | (tcon->treeName, uncName, |
1291 | MAX_TREE_SIZE) == 0) { | 1291 | MAX_TREE_SIZE) == 0) { |
1292 | cFYI(1, | 1292 | cFYI(1, |
1293 | ("Matched UNC, old user: %s == new: %s ?", | 1293 | ("and old usr: %s new: %s", |
1294 | tcon->treeName, uncName)); | 1294 | tcon->treeName, uncName)); |
1295 | if (strncmp | 1295 | if (strncmp |
1296 | (tcon->ses->userName, | 1296 | (tcon->ses->userName, |
1297 | userName, | 1297 | userName, |
1298 | MAX_USERNAME_SIZE) == 0) { | 1298 | MAX_USERNAME_SIZE) == 0) { |
1299 | read_unlock(&GlobalSMBSeslock); | 1299 | read_unlock(&GlobalSMBSeslock); |
1300 | return tcon;/* also matched user (smb session)*/ | 1300 | /* matched smb session |
1301 | (user name */ | ||
1302 | return tcon; | ||
1301 | } | 1303 | } |
1302 | } | 1304 | } |
1303 | } | 1305 | } |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index ba4cbe9b0684..914239d53634 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -267,6 +267,10 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
267 | pCifsFile->invalidHandle = FALSE; | 267 | pCifsFile->invalidHandle = FALSE; |
268 | pCifsFile->closePend = FALSE; | 268 | pCifsFile->closePend = FALSE; |
269 | init_MUTEX(&pCifsFile->fh_sem); | 269 | init_MUTEX(&pCifsFile->fh_sem); |
270 | init_MUTEX(&pCifsFile->lock_sem); | ||
271 | INIT_LIST_HEAD(&pCifsFile->llist); | ||
272 | atomic_set(&pCifsFile->wrtPending,0); | ||
273 | |||
270 | /* set the following in open now | 274 | /* set the following in open now |
271 | pCifsFile->pfile = file; */ | 275 | pCifsFile->pfile = file; */ |
272 | write_lock(&GlobalSMBSeslock); | 276 | write_lock(&GlobalSMBSeslock); |