diff options
author | Steve French <smfrench@austin.rr.com> | 2005-04-29 01:41:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-29 01:41:07 -0400 |
commit | 848f3fce45d2ba93e10b5e9d65bcae0d9269ad0d (patch) | |
tree | 103c63af4e29ee400b0bef59ed5a9d0be65a7a2b | |
parent | d0724714fd49aeec1383b94807174de7e96021bf (diff) |
[PATCH] cifs: Do not interpret oplock break responses as responses to an unrelated command
.. even if the multiplex ids match.
Signed-off-by: Steve French (sfrench@us.ibm.com)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/cifs/CHANGES | 2 | ||||
-rw-r--r-- | fs/cifs/cifs_debug.c | 7 | ||||
-rw-r--r-- | fs/cifs/cifsglob.h | 2 | ||||
-rw-r--r-- | fs/cifs/connect.c | 10 | ||||
-rw-r--r-- | fs/cifs/transport.c | 1 |
5 files changed, 16 insertions, 6 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index de8858028d64..de63a0e3f4ce 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -10,6 +10,8 @@ different users from the same client to the same server. Fix oops in | |||
10 | cifs_close. Add mount option for remapping reserved characters in | 10 | cifs_close. Add mount option for remapping reserved characters in |
11 | filenames (also allow recognizing files with created by SFU which have any | 11 | filenames (also allow recognizing files with created by SFU which have any |
12 | of these seven reserved characters, except backslash, to be recognized). | 12 | of these seven reserved characters, except backslash, to be recognized). |
13 | Fix invalid transact2 message (we were sometimes trying to interpret | ||
14 | oplock breaks as SMB responses). | ||
13 | 15 | ||
14 | Version 1.31 | 16 | Version 1.31 |
15 | ------------ | 17 | ------------ |
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index e7bd93e6226d..efa099165b22 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -111,7 +111,12 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
111 | mid_q_entry, | 111 | mid_q_entry, |
112 | qhead); | 112 | qhead); |
113 | if(mid_entry) { | 113 | if(mid_entry) { |
114 | length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p mid %d\n",mid_entry->midState,mid_entry->command,mid_entry->pid,mid_entry->tsk,mid_entry->mid); | 114 | length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p mid %d\n", |
115 | mid_entry->midState, | ||
116 | (int)mid_entry->command, | ||
117 | mid_entry->pid, | ||
118 | mid_entry->tsk, | ||
119 | mid_entry->mid); | ||
115 | buf += length; | 120 | buf += length; |
116 | } | 121 | } |
117 | } | 122 | } |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 1b3082d79379..fe1409799513 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -313,12 +313,12 @@ struct mid_q_entry { | |||
313 | __u16 mid; /* multiplex id */ | 313 | __u16 mid; /* multiplex id */ |
314 | __u16 pid; /* process id */ | 314 | __u16 pid; /* process id */ |
315 | __u32 sequence_number; /* for CIFS signing */ | 315 | __u32 sequence_number; /* for CIFS signing */ |
316 | __u16 command; /* smb command code */ | ||
317 | struct timeval when_sent; /* time when smb sent */ | 316 | struct timeval when_sent; /* time when smb sent */ |
318 | struct cifsSesInfo *ses; /* smb was sent to this server */ | 317 | struct cifsSesInfo *ses; /* smb was sent to this server */ |
319 | struct task_struct *tsk; /* task waiting for response */ | 318 | struct task_struct *tsk; /* task waiting for response */ |
320 | struct smb_hdr *resp_buf; /* response buffer */ | 319 | struct smb_hdr *resp_buf; /* response buffer */ |
321 | int midState; /* wish this were enum but can not pass to wait_event */ | 320 | int midState; /* wish this were enum but can not pass to wait_event */ |
321 | __u8 command; /* smb command code */ | ||
322 | }; | 322 | }; |
323 | 323 | ||
324 | struct oplock_q_entry { | 324 | struct oplock_q_entry { |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 1f22b85324cf..383e55fa7d26 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -361,9 +361,13 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) | |||
361 | mid_q_entry, | 361 | mid_q_entry, |
362 | qhead); | 362 | qhead); |
363 | 363 | ||
364 | if ((mid_entry->mid == smb_buffer->Mid) && (mid_entry->midState == MID_REQUEST_SUBMITTED)) { | 364 | if ((mid_entry->mid == smb_buffer->Mid) |
365 | cFYI(1, | 365 | && (mid_entry->midState == |
366 | (" Mid 0x%x matched - waking up ",mid_entry->mid)); | 366 | MID_REQUEST_SUBMITTED) |
367 | && (mid_entry->command == | ||
368 | smb_buffer->Command)) { | ||
369 | cFYI(1,("Found Mid 0x%x wake up" | ||
370 | ,mid_entry->mid)); | ||
367 | task_to_wake = mid_entry->tsk; | 371 | task_to_wake = mid_entry->tsk; |
368 | mid_entry->resp_buf = | 372 | mid_entry->resp_buf = |
369 | smb_buffer; | 373 | smb_buffer; |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index a9e4f989b7f7..aab62ed46982 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -189,7 +189,6 @@ smb_sendv(struct socket *ssocket, struct smb_hdr *smb_buffer, | |||
189 | struct msghdr smb_msg; | 189 | struct msghdr smb_msg; |
190 | number_of_pages += 1; /* account for SMB header */ | 190 | number_of_pages += 1; /* account for SMB header */ |
191 | struct kvec * piov = kmalloc(number_of_pages * sizeof(struct kvec)); | 191 | struct kvec * piov = kmalloc(number_of_pages * sizeof(struct kvec)); |
192 | if(i=0;i<num_pages-1;i++ | ||
193 | unsigned len = smb_buf_length + 4; | 192 | unsigned len = smb_buf_length + 4; |
194 | 193 | ||
195 | if(ssocket == NULL) | 194 | if(ssocket == NULL) |