------------
Fix reconnection (and certain failed mounts) to properly wake up the
blocked users thread so it does not seem hung (in some cases was blocked
-until the cifs receive timeout expired).
+until the cifs receive timeout expired). Fix spurious error logging
+to kernel log when application with open network files killed.
Version 1.09
------------
spin_lock(&GlobalMid_Lock);
if(list_empty(&GlobalOplock_Q)) {
spin_unlock(&GlobalMid_Lock);
+ set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(39*HZ);
} else {
oplock_item = list_entry(GlobalOplock_Q.next,
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
(struct smb_hdr *) pSMBr, &bytes_returned, 0);
if (rc) {
- cERROR(1, ("Send error in Close = %d", rc));
+ if(rc!=-EINTR) {
+ /* EINTR is expected when user ctl-c to kill app */
+ cERROR(1, ("Send error in Close = %d", rc));
+ }
}
if (pSMB)
cifs_buf_release(pSMB);
csocket = server->ssocket;
continue;
} else if ((length == -ERESTARTSYS) || (length == -EAGAIN)) {
+ set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(1); /* minimum sleep to prevent looping
allowing socket to clear and app threads to set
tcpStatus CifsNeedReconnect if server hung */
} else {
/* give server a second to
clean up before reconnect attempt */
+ set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);
/* always try 445 first on reconnect
since we get NACK on some if we ever
set_fs(get_ds());
rc = sock_sendmsg(ssocket, &smb_msg, smb_buf_length + 4);
while((rc == -ENOSPC) || (rc == -EAGAIN)) {
+ set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ/2);
rc = sock_sendmsg(ssocket, &smb_msg, smb_buf_length + 4);
}
timeout = 15 * HZ;
/* wait for 15 seconds or until woken up due to response arriving or
due to last connection to this server being unmounted */
-
- timeout = wait_event_interruptible_timeout(ses->server->response_q,
- (midQ->midState & MID_RESPONSE_RECEIVED) ||
- ((ses->server->tcpStatus != CifsGood) &&
- (ses->server->tcpStatus != CifsNew)),
- timeout);
if (signal_pending(current)) {
- cFYI(1, ("CIFS: caught signal"));
+ /* if signal pending do not hold up user for full smb timeout
+ but we still give response a change to complete */
+ if(midQ->midState & MID_REQUEST_SUBMITTED) {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ timeout = schedule_timeout(HZ);
+ }
+ } else { /* use normal timeout */
+ timeout = wait_event_interruptible_timeout(ses->server->response_q,
+ (midQ->midState & MID_RESPONSE_RECEIVED) ||
+ ((ses->server->tcpStatus != CifsGood) &&
+ (ses->server->tcpStatus != CifsNew)),
+ timeout);
+ }
+ if (signal_pending(current)) {
DeleteMidQEntry(midQ);
- return -EINTR;
+ return -EINTR; /* BB are we supposed to return -ERESTARTSYS ? */
} else { /* BB spinlock protect this against races with demux thread */
spin_lock(&GlobalMid_Lock);
if (midQ->resp_buf) {