diff options
| author | Jeff Layton <jlayton@redhat.com> | 2009-06-27 07:04:55 -0400 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2009-06-27 19:46:43 -0400 |
| commit | f0a71eb820596bd8f6abf64beb4cb181edaa2341 (patch) | |
| tree | f46ee612397a696ff1f601f9c5960a0eb5ed0c26 | |
| parent | 4075ea8c54a7506844a69f674990241e7766357b (diff) | |
cifs: fix fh_mutex locking in cifs_reopen_file
Fixes a regression caused by commit a6ce4932fbdbcd8f8e8c6df76812014351c32892
When this lock was converted to a mutex, the locks were turned into
unlocks and vice-versa.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
| -rw-r--r-- | fs/cifs/file.c | 10 |
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; |
| 529 | reopen_error_exit: | 529 | reopen_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 { |
| 576 | reopen_success: | 576 | reopen_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) { |
