From 0518a247c84321329807f422d2f9229f1e13a4c5 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Thu, 10 May 2007 18:38:43 -0400 Subject: [PATCH] --- yaml --- r: 55877 b: refs/heads/master c: 129a84de2347002f09721cda3155ccfd19fade40 h: refs/heads/master i: 55875: a40be6fb68a0f1e227a2b10d445ff64abfb74932 v: v3 --- [refs] | 2 +- trunk/fs/locks.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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; }