Commit a093070b authored by Steve French's avatar Steve French Committed by Steve French

finish off move from reopening all files on reconnection (which takes too long...

finish off move from reopening all files on reconnection (which takes too long under heavy stress) to reopen file as needed after reconnection to server.
parent 1915ad84
......@@ -211,7 +211,6 @@ struct cifsFileInfo {
struct inode * pInode; /* needed for oplock break */
int endOfSearch:1; /* we have reached end of search */
int closePend:1; /* file is marked to close */
int reopenPend:1; /* reopen of file in progress */
int emptyDir:1;
int invalidHandle:1; /* file closed via session abend */
char * search_resume_name;
......
......@@ -75,7 +75,6 @@ extern int cifs_get_inode_info_unix(struct inode **pinode,
const unsigned char *search_path,
struct super_block *sb);
extern int reopen_files(struct cifsTconInfo *, struct nls_table *);
extern int setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
struct nls_table * nls_info);
extern int CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses);
......
......@@ -41,11 +41,30 @@ static struct {
int index;
char *name;
} protocols[] = {
{
CIFS_PROT, "\2NT LM 0.12"}, {
BAD_PROT, "\2"}
{CIFS_PROT, "\2NT LM 0.12"},
{BAD_PROT, "\2"}
};
/* Mark as invalid, all open files on tree connections since they
were closed when session to server was lost */
void mark_open_files_invalid(struct cifsTconInfo * pTcon)
{
struct cifsFileInfo *open_file = NULL;
struct list_head * tmp;
struct list_head * tmp1;
/* list all files open on tree connection and mark them invalid */
write_lock(&GlobalSMBSeslock);
list_for_each_safe(tmp, tmp1, &pTcon->openFileList) {
open_file = list_entry(tmp,struct cifsFileInfo, tlist);
if(open_file) {
open_file->invalidHandle = TRUE;
}
}
write_unlock(&GlobalSMBSeslock);
}
int
smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
void **request_buf /* returned */ ,
......@@ -75,15 +94,14 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
if(tcon->ses->status == CifsNeedReconnect)
rc = setup_session(0, tcon->ses, nls_codepage);
if(!rc && (tcon->tidStatus == CifsNeedReconnect)) {
mark_open_files_invalid(tcon);
rc = CIFSTCon(0, tcon->ses, tcon->treeName, tcon,
nls_codepage);
up(&tcon->ses->sesSem);
cFYI(1, ("reconnect tcon rc = %d", rc));
/* Remove call to reopen files here -
it is safer (and faster) to reopen
files as needed in read and write */
/* if(!rc)
reopen_files(tcon,nls_codepage);*/
/* Removed call to reopen open files here -
it is safer (and faster) to reopen files
one at a time as needed in read and write */
} else {
up(&tcon->ses->sesSem);
}
......
This diff is collapsed.
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