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

Fix oops in cifs reopen files (restoring state after server comes back from failure)

parent 5bb2dc6d
Version 0.85
------------
Fix oops in mkdir when server fails to return inode info.
Fix oops in mkdir when server fails to return inode info. Fix oops in reopen_files
during auto reconnection to server after server recovered from failure.
Version 0.84
------------
......
......@@ -251,7 +251,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
/* iov.iov_base = smb_buffer+total_read;
iov.iov_len = pdu_length-total_read; */
length = sock_recvmsg(csocket, &smb_msg,
pdu_length - total_read, 0);
pdu_length - total_read, 0);
/* cERROR(1,("For iovlen %d Length received: %d with total read %d",
iov.iov_len, length,total_read)); */
if (length == 0) {
......
......@@ -190,12 +190,14 @@ int reopen_files(struct cifsTconInfo * pTcon, struct nls_table * nlsinfo)
/* list all files open on tree connection */
read_lock(&GlobalSMBSeslock);
list_for_each_safe(tmp, tmp1, &pTcon->openFileList) {
open_file = list_entry(tmp,struct cifsFileInfo, flist);
open_file = list_entry(tmp,struct cifsFileInfo, tlist);
if(open_file) {
if(open_file->search_resume_name) {
kfree(open_file->search_resume_name);
}
file = open_file->pfile;
list_del(&open_file->flist);
list_del(&open_file->tlist);
kfree(open_file);
if(file) {
file->private_data = NULL;
......@@ -232,8 +234,7 @@ cifs_close(struct inode *inode, struct file *file)
pTcon = cifs_sb->tcon;
if (pSMBFile) {
write_lock(&file->f_owner.lock);
if(pSMBFile->flist.next)
list_del(&pSMBFile->flist);
list_del(&pSMBFile->flist);
list_del(&pSMBFile->tlist);
write_unlock(&file->f_owner.lock);
rc = CIFSSMBClose(xid, pTcon, pSMBFile->netfid);
......
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