From c31c9d44a1151c0ed49cb353ab1dfe7d68c0ac2e Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Thu, 29 Jun 2006 16:38:37 -0400 Subject: [PATCH] --- yaml --- r: 32125 b: refs/heads/master c: f07f18dd6f29f11887b8d9cf7ecb736bf2f7dc62 h: refs/heads/master i: 32123: 2983771409956b50e824d09f358ed2f8e25d73e8 v: v3 --- [refs] | 2 +- trunk/fs/locks.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index bcc025af2042..d1a9c886755e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 42a2d13eee3c895d22e9d1a52b96d15ca49adabc +refs/heads/master: f07f18dd6f29f11887b8d9cf7ecb736bf2f7dc62 diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index 50cb0a2b74d9..b0b41a64e10b 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -739,6 +739,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) int found = 0; lock_kernel(); + if (request->fl_flags & FL_ACCESS) + goto find_conflict; for_each_lock(inode, before) { struct file_lock *fl = *before; if (IS_POSIX(fl)) @@ -771,6 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) if (found) cond_resched(); +find_conflict: for_each_lock(inode, before) { struct file_lock *fl = *before; if (IS_POSIX(fl)) @@ -784,6 +787,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) locks_insert_block(fl, request); goto out; } + if (request->fl_flags & FL_ACCESS) + goto out; locks_copy_lock(new_fl, request); locks_insert_lock(&inode->i_flock, new_fl); new_fl = NULL;