diff options
author | Steve French <smfrench@austin.rr.com> | 2005-04-29 01:41:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-29 01:41:10 -0400 |
commit | cd63499cbe37e53e6cc084c8a35d911a4613c797 (patch) | |
tree | 5f365aa9daaf89a9890c53dc681474a7fd292e45 /fs/cifs/connect.c | |
parent | 275cde1a1f3880601509c851d72c82bb8d3ee67c (diff) |
[PATCH] cifs: Handle case of multiple trans2 responses for one SMB request (part 2 of 2)
Signed-off-by: Steve French (sfrench@us.ibm.com)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index a8d592bc33fe..e3b177a90b37 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -544,15 +544,13 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) | |||
544 | if ((mid_entry->mid == smb_buffer->Mid) && | 544 | if ((mid_entry->mid == smb_buffer->Mid) && |
545 | (mid_entry->midState == MID_REQUEST_SUBMITTED) && | 545 | (mid_entry->midState == MID_REQUEST_SUBMITTED) && |
546 | (mid_entry->command == smb_buffer->Command)) { | 546 | (mid_entry->command == smb_buffer->Command)) { |
547 | cFYI(1,("Found Mid 0x%x wake", mid_entry->mid)); | ||
548 | |||
549 | if(check2ndT2(smb_buffer,server->maxBuf) > 0) { | 547 | if(check2ndT2(smb_buffer,server->maxBuf) > 0) { |
550 | /* We have a multipart transact2 resp */ | 548 | /* We have a multipart transact2 resp */ |
549 | isMultiRsp = TRUE; | ||
551 | if(mid_entry->resp_buf) { | 550 | if(mid_entry->resp_buf) { |
552 | /* merge response - fix up 1st*/ | 551 | /* merge response - fix up 1st*/ |
553 | if(coalesce_t2(smb_buffer, | 552 | if(coalesce_t2(smb_buffer, |
554 | mid_entry->resp_buf)) { | 553 | mid_entry->resp_buf)) { |
555 | isMultiRsp = TRUE; | ||
556 | break; | 554 | break; |
557 | } else { | 555 | } else { |
558 | /* all parts received */ | 556 | /* all parts received */ |
@@ -564,10 +562,10 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) | |||
564 | /* BB maybe we can fix this up, switch | 562 | /* BB maybe we can fix this up, switch |
565 | to already allocated large buffer? */ | 563 | to already allocated large buffer? */ |
566 | } else { | 564 | } else { |
565 | /* Have first buffer */ | ||
567 | mid_entry->resp_buf = | 566 | mid_entry->resp_buf = |
568 | smb_buffer; | 567 | smb_buffer; |
569 | mid_entry->largeBuf = 1; | 568 | mid_entry->largeBuf = 1; |
570 | isMultiRsp = TRUE; | ||
571 | bigbuf = NULL; | 569 | bigbuf = NULL; |
572 | } | 570 | } |
573 | } | 571 | } |
@@ -586,11 +584,14 @@ multi_t2_fnd: | |||
586 | } | 584 | } |
587 | spin_unlock(&GlobalMid_Lock); | 585 | spin_unlock(&GlobalMid_Lock); |
588 | if (task_to_wake) { | 586 | if (task_to_wake) { |
589 | if(isLargeBuf) | 587 | /* Was previous buf put in mpx struct for multi-rsp? */ |
590 | bigbuf = NULL; | 588 | if(!isMultiRsp) { |
591 | else | 589 | /* smb buffer will be freed by user thread */ |
592 | smallbuf = NULL; | 590 | if(isLargeBuf) { |
593 | /* smb buffer freed by user thread when done */ | 591 | bigbuf = NULL; |
592 | } else | ||
593 | smallbuf = NULL; | ||
594 | } | ||
594 | wake_up_process(task_to_wake); | 595 | wake_up_process(task_to_wake); |
595 | } else if ((is_valid_oplock_break(smb_buffer) == FALSE) | 596 | } else if ((is_valid_oplock_break(smb_buffer) == FALSE) |
596 | && (isMultiRsp == FALSE)) { | 597 | && (isMultiRsp == FALSE)) { |