aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-28 14:08:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-28 14:08:09 -0400
commit4142ac678a864972ce1dfad6d9cb22f075fee5de (patch)
treeeb0fced95a242fde42a9b2cc132dba0a36c2e99a
parenta679128d30d0303bbf5cac839c8f6f45793ea775 (diff)
parentf0a71eb820596bd8f6abf64beb4cb181edaa2341 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: cifs: fix fh_mutex locking in cifs_reopen_file
-rw-r--r--fs/cifs/file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index ebdbe62a829c..97ce4bf89d15 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -493,9 +493,9 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
493 return -EBADF; 493 return -EBADF;
494 494
495 xid = GetXid(); 495 xid = GetXid();
496 mutex_unlock(&pCifsFile->fh_mutex); 496 mutex_lock(&pCifsFile->fh_mutex);
497 if (!pCifsFile->invalidHandle) { 497 if (!pCifsFile->invalidHandle) {
498 mutex_lock(&pCifsFile->fh_mutex); 498 mutex_unlock(&pCifsFile->fh_mutex);
499 rc = 0; 499 rc = 0;
500 FreeXid(xid); 500 FreeXid(xid);
501 return rc; 501 return rc;
@@ -527,7 +527,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
527 if (full_path == NULL) { 527 if (full_path == NULL) {
528 rc = -ENOMEM; 528 rc = -ENOMEM;
529reopen_error_exit: 529reopen_error_exit:
530 mutex_lock(&pCifsFile->fh_mutex); 530 mutex_unlock(&pCifsFile->fh_mutex);
531 FreeXid(xid); 531 FreeXid(xid);
532 return rc; 532 return rc;
533 } 533 }
@@ -569,14 +569,14 @@ reopen_error_exit:
569 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & 569 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
570 CIFS_MOUNT_MAP_SPECIAL_CHR); 570 CIFS_MOUNT_MAP_SPECIAL_CHR);
571 if (rc) { 571 if (rc) {
572 mutex_lock(&pCifsFile->fh_mutex); 572 mutex_unlock(&pCifsFile->fh_mutex);
573 cFYI(1, ("cifs_open returned 0x%x", rc)); 573 cFYI(1, ("cifs_open returned 0x%x", rc));
574 cFYI(1, ("oplock: %d", oplock)); 574 cFYI(1, ("oplock: %d", oplock));
575 } else { 575 } else {
576reopen_success: 576reopen_success:
577 pCifsFile->netfid = netfid; 577 pCifsFile->netfid = netfid;
578 pCifsFile->invalidHandle = false; 578 pCifsFile->invalidHandle = false;
579 mutex_lock(&pCifsFile->fh_mutex); 579 mutex_unlock(&pCifsFile->fh_mutex);
580 pCifsInode = CIFS_I(inode); 580 pCifsInode = CIFS_I(inode);
581 if (pCifsInode) { 581 if (pCifsInode) {
582 if (can_flush) { 582 if (can_flush) {