Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  cifs: fix fh_mutex locking in cifs_reopen_file
  • Loading branch information
Linus Torvalds committed Jun 28, 2009
2 parents a679128 + f0a71eb commit 4142ac6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
return -EBADF;

xid = GetXid();
mutex_unlock(&pCifsFile->fh_mutex);
mutex_lock(&pCifsFile->fh_mutex);
if (!pCifsFile->invalidHandle) {
mutex_lock(&pCifsFile->fh_mutex);
mutex_unlock(&pCifsFile->fh_mutex);
rc = 0;
FreeXid(xid);
return rc;
Expand Down Expand Up @@ -527,7 +527,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
if (full_path == NULL) {
rc = -ENOMEM;
reopen_error_exit:
mutex_lock(&pCifsFile->fh_mutex);
mutex_unlock(&pCifsFile->fh_mutex);
FreeXid(xid);
return rc;
}
Expand Down Expand Up @@ -569,14 +569,14 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
if (rc) {
mutex_lock(&pCifsFile->fh_mutex);
mutex_unlock(&pCifsFile->fh_mutex);
cFYI(1, ("cifs_open returned 0x%x", rc));
cFYI(1, ("oplock: %d", oplock));
} else {
reopen_success:
pCifsFile->netfid = netfid;
pCifsFile->invalidHandle = false;
mutex_lock(&pCifsFile->fh_mutex);
mutex_unlock(&pCifsFile->fh_mutex);
pCifsInode = CIFS_I(inode);
if (pCifsInode) {
if (can_flush) {
Expand Down

0 comments on commit 4142ac6

Please sign in to comment.