Commit 5cb34289 authored by Steve French's avatar Steve French

fix oops in heavy stress test caused by lack of check for bad dentry being passed in on reconnect

parent 2868fd35
......@@ -38,7 +38,7 @@ renew_parental_timestamps(struct dentry *direntry)
do {
direntry->d_time = jiffies;
direntry = direntry->d_parent;
} while (!IS_ROOT(direntry)); /* BB for DFS case should stop at the root of share which could be lower than root of this mount due to implicit dfs connections */
} while (!IS_ROOT(direntry));
}
/* Note: caller must free return buffer */
......@@ -49,6 +49,11 @@ build_path_from_dentry(struct dentry *direntry)
int namelen = 0;
char *full_path;
if(direntry == NULL)
return NULL; /* not much we can do if dentry is freed and
we need to reopen the file after it was closed implicitly
when the server crashed */
for (temp = direntry; !IS_ROOT(temp);) {
namelen += (1 + temp->d_name.len);
temp = temp->d_parent;
......
......@@ -283,7 +283,12 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
return 0;
}
if(file->f_dentry == NULL) {
up(&pCifsFile->fh_sem);
cFYI(1,("failed file reopen, no valid name if dentry freed"));
FreeXid(xid);
return -EBADF;
}
cifs_sb = CIFS_SB(inode->i_sb);
pTcon = cifs_sb->tcon;
......
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