aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/locks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 671a034dc999..8ec16ab5ef74 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -669,7 +669,6 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
669{ 669{
670 struct file_lock *cfl; 670 struct file_lock *cfl;
671 671
672 fl->fl_type = F_UNLCK;
673 lock_kernel(); 672 lock_kernel();
674 for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) { 673 for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) {
675 if (!IS_POSIX(cfl)) 674 if (!IS_POSIX(cfl))
@@ -681,7 +680,8 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
681 __locks_copy_lock(fl, cfl); 680 __locks_copy_lock(fl, cfl);
682 unlock_kernel(); 681 unlock_kernel();
683 return 1; 682 return 1;
684 } 683 } else
684 fl->fl_type = F_UNLCK;
685 unlock_kernel(); 685 unlock_kernel();
686 return 0; 686 return 0;
687} 687}
@@ -1632,6 +1632,7 @@ static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl)
1632 flock->l_len = fl->fl_end == OFFSET_MAX ? 0 : 1632 flock->l_len = fl->fl_end == OFFSET_MAX ? 0 :
1633 fl->fl_end - fl->fl_start + 1; 1633 fl->fl_end - fl->fl_start + 1;
1634 flock->l_whence = 0; 1634 flock->l_whence = 0;
1635 flock->l_type = fl->fl_type;
1635 return 0; 1636 return 0;
1636} 1637}
1637 1638