Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232706
b: refs/heads/master
c: 1be912d
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Layton authored and Steve French committed Jan 31, 2011
1 parent 223ac37 commit 125e9a4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 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: 58b8a5b45a097b477c037bc376e65dc5f214bf3d
refs/heads/master: 1be912dde772b77aaaa21770eeabb0a7a5e297a6
43 changes: 36 additions & 7 deletions trunk/fs/cifs/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,17 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
goto out;

rc = wait_for_response(ses->server, midQ);
if (rc != 0)
goto out;
if (rc != 0) {
spin_lock(&GlobalMid_Lock);
if (midQ->midState == MID_REQUEST_SUBMITTED) {
midQ->callback = DeleteMidQEntry;
spin_unlock(&GlobalMid_Lock);
atomic_dec(&ses->server->inFlight);
wake_up(&ses->server->request_q);
return rc;
}
spin_unlock(&GlobalMid_Lock);
}

rc = sync_mid_result(midQ, ses->server);
if (rc != 0) {
Expand Down Expand Up @@ -724,8 +733,18 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
goto out;

rc = wait_for_response(ses->server, midQ);
if (rc != 0)
goto out;
if (rc != 0) {
spin_lock(&GlobalMid_Lock);
if (midQ->midState == MID_REQUEST_SUBMITTED) {
/* no longer considered to be "in-flight" */
midQ->callback = DeleteMidQEntry;
spin_unlock(&GlobalMid_Lock);
atomic_dec(&ses->server->inFlight);
wake_up(&ses->server->request_q);
return rc;
}
spin_unlock(&GlobalMid_Lock);
}

rc = sync_mid_result(midQ, ses->server);
if (rc != 0) {
Expand Down Expand Up @@ -922,10 +941,20 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
}
}

if (wait_for_response(ses->server, midQ) == 0) {
/* We got the response - restart system call. */
rstart = 1;
rc = wait_for_response(ses->server, midQ);
if (rc) {
spin_lock(&GlobalMid_Lock);
if (midQ->midState == MID_REQUEST_SUBMITTED) {
/* no longer considered to be "in-flight" */
midQ->callback = DeleteMidQEntry;
spin_unlock(&GlobalMid_Lock);
return rc;
}
spin_unlock(&GlobalMid_Lock);
}

/* We got the response - restart system call. */
rstart = 1;
}

rc = sync_mid_result(midQ, ses->server);
Expand Down

0 comments on commit 125e9a4

Please sign in to comment.