Commit 4142ac67 authored by Linus Torvalds's avatar Linus Torvalds
parents a679128d f0a71eb8
...@@ -493,9 +493,9 @@ static int cifs_reopen_file(struct file *file, bool can_flush) ...@@ -493,9 +493,9 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
return -EBADF; return -EBADF;
xid = GetXid(); xid = GetXid();
mutex_unlock(&pCifsFile->fh_mutex);
if (!pCifsFile->invalidHandle) {
mutex_lock(&pCifsFile->fh_mutex); mutex_lock(&pCifsFile->fh_mutex);
if (!pCifsFile->invalidHandle) {
mutex_unlock(&pCifsFile->fh_mutex);
rc = 0; rc = 0;
FreeXid(xid); FreeXid(xid);
return rc; return rc;
...@@ -527,7 +527,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush) ...@@ -527,7 +527,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
if (full_path == NULL) { if (full_path == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
reopen_error_exit: reopen_error_exit:
mutex_lock(&pCifsFile->fh_mutex); mutex_unlock(&pCifsFile->fh_mutex);
FreeXid(xid); FreeXid(xid);
return rc; return rc;
} }
...@@ -569,14 +569,14 @@ reopen_error_exit: ...@@ -569,14 +569,14 @@ reopen_error_exit:
cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR); CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc) { if (rc) {
mutex_lock(&pCifsFile->fh_mutex); mutex_unlock(&pCifsFile->fh_mutex);
cFYI(1, ("cifs_open returned 0x%x", rc)); cFYI(1, ("cifs_open returned 0x%x", rc));
cFYI(1, ("oplock: %d", oplock)); cFYI(1, ("oplock: %d", oplock));
} else { } else {
reopen_success: reopen_success:
pCifsFile->netfid = netfid; pCifsFile->netfid = netfid;
pCifsFile->invalidHandle = false; pCifsFile->invalidHandle = false;
mutex_lock(&pCifsFile->fh_mutex); mutex_unlock(&pCifsFile->fh_mutex);
pCifsInode = CIFS_I(inode); pCifsInode = CIFS_I(inode);
if (pCifsInode) { if (pCifsInode) {
if (can_flush) { if (can_flush) {
......
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