diff --git a/[refs] b/[refs] index c65dbc0f184d..f0ec808b8324 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a9deecba19b8f384d97f82c75379da48bccb2588 +refs/heads/master: 129a84de2347002f09721cda3155ccfd19fade40 diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index 671a034dc999..8ec16ab5ef74 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -669,7 +669,6 @@ posix_test_lock(struct file *filp, struct file_lock *fl) { struct file_lock *cfl; - fl->fl_type = F_UNLCK; lock_kernel(); for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) { if (!IS_POSIX(cfl)) @@ -681,7 +680,8 @@ posix_test_lock(struct file *filp, struct file_lock *fl) __locks_copy_lock(fl, cfl); unlock_kernel(); return 1; - } + } else + fl->fl_type = F_UNLCK; unlock_kernel(); return 0; } @@ -1632,6 +1632,7 @@ static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) flock->l_len = fl->fl_end == OFFSET_MAX ? 0 : fl->fl_end - fl->fl_start + 1; flock->l_whence = 0; + flock->l_type = fl->fl_type; return 0; }