Commit 3c59d320 authored by Steve French's avatar Steve French Committed by Steve French

Do not grab i_sem (already taken in filemap.c across commit write calls)...

Do not grab i_sem (already taken in filemap.c across commit write calls) during reopen of invalidated file handle.
parent 4024c058
......@@ -218,6 +218,7 @@ struct cifsFileInfo {
int closePend:1; /* file is marked to close */
int emptyDir:1;
int invalidHandle:1; /* file closed via session abend */
struct semaphore fh_sem; /* prevents reopen race after dead ses*/
char * search_resume_name;
unsigned int resume_name_length;
__u32 resume_key;
......@@ -319,7 +320,7 @@ struct servers_not_supported { /* @z4a */
* ----------
* sesSem operations on smb session
* tconSem operations on tree connection
* i_sem inode operations
* fh_sem file handle reconnection operations
*
****************************************************************************/
......
......@@ -230,9 +230,9 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
return -EBADF;
xid = GetXid();
down(&inode->i_sem);
down(&pCifsFile->fh_sem);
if(pCifsFile->invalidHandle == FALSE) {
up(&inode->i_sem);
up(&pCifsFile->fh_sem);
FreeXid(xid);
return 0;
}
......@@ -263,7 +263,7 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
helps non-Unix server case */
buf = kmalloc(sizeof(FILE_ALL_INFO),GFP_KERNEL);
if(buf==0) {
up(&inode->i_sem);
up(&pCifsFile->fh_sem);
if (full_path)
kfree(full_path);
FreeXid(xid);
......@@ -272,13 +272,13 @@ static int cifs_reopen_file(struct inode *inode, struct file *file)
rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, desiredAccess,
CREATE_NOT_DIR, &netfid, &oplock, buf, cifs_sb->local_nls);
if (rc) {
up(&inode->i_sem);
up(&pCifsFile->fh_sem);
cFYI(1, ("cifs_open returned 0x%x ", rc));
cFYI(1, ("oplock: %d ", oplock));
} else {
pCifsFile->netfid = netfid;
pCifsFile->invalidHandle = FALSE;
up(&inode->i_sem);
up(&pCifsFile->fh_sem);
pCifsInode = CIFS_I(file->f_dentry->d_inode);
if(pCifsInode) {
if (pTcon->ses->capabilities & CAP_UNIX)
......
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