Commit 9baf76e9 authored by Steve French's avatar Steve French Committed by Steve French

fix oops in send_sig on unmount of cifs vfs due to sending signal to...

fix oops in send_sig on unmount of cifs vfs due to sending signal to demultiplex thread after it has exited.  
Do not treat invalid handle warning in response to oplock break (of file that is now closed) as an error.
parent 3ea7f245
Verison 0.95
Version 0.96
------------
Fix oops (in send_sig) caused by CIFS unmount code trying to
wake up the demultiplex thread after it had exited. Do not log
error on harmless oplock release of closed handle.
Version 0.95
------------
Fix unsafe global variable usage and password hash failure on gcc 3.3.1
Fix problem reconnecting secondary mounts to same server after session
......
......@@ -317,9 +317,10 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
}
}
/* BB add code to lock SMB sessions while releasing */
server->tsk = NULL;
if(server->ssocket) {
sock_release(csocket);
server->ssocket = NULL;
server->ssocket = NULL;
}
set_fs(temp_fs);
if (smb_buffer) /* buffer usually freed in free_mid - need to free it on error or exit */
......@@ -1064,8 +1065,6 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
CIFSSMBLogoff(xid, pSesInfo);
if(pSesInfo->server->tsk)
send_sig(SIGKILL,pSesInfo->server->tsk,1);
else
cFYI(1,("Can not wake captive thread on cleanup of failed mount"));
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ / 4); /* give captive thread time to exit */
} else
......
......@@ -25,6 +25,8 @@
#include "cifsglob.h"
#include "cifsproto.h"
#include "cifs_debug.h"
#include "smberr.h"
#include "nterr.h"
extern kmem_cache_t *cifs_req_cachep;
extern struct task_struct * oplockThread;
......@@ -369,8 +371,22 @@ is_valid_oplock_break(struct smb_hdr *buf)
cFYI(1,("Checking for oplock break"));
if(pSMB->hdr.Command != SMB_COM_LOCKING_ANDX)
return FALSE;
if(pSMB->hdr.Flags & SMBFLG_RESPONSE)
return FALSE; /* server sends us "request" here */
if(pSMB->hdr.Flags & SMBFLG_RESPONSE) {
/* no sense logging error on invalid handle on oplock
break - harmless race between close request and oplock
break response is expected from time to time writing out
large dirty files cached on the client */
if ((NT_STATUS_INVALID_HANDLE) ==
le32_to_cpu(pSMB->hdr.Status.CifsError)) {
cFYI(1,("invalid handle on oplock break"));
return TRUE;
} else if (ERRbadfid ==
le16_to_cpu(pSMB->hdr.Status.DosError.Error)) {
return TRUE;
} else {
return FALSE; /* on valid oplock brk we get "request" */
}
}
if(pSMB->hdr.WordCount != 8)
return FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment