Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29029
b: refs/heads/master
c: 39005d0
h: refs/heads/master
i:
  29027: b223fcf
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Jun 23, 2006
1 parent e5f0470 commit 5ffa01b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d9a490abe1f69fda220f7866f6f23af41daa128
refs/heads/master: 39005d022ad221b76dc2de0ac62ef475a796433b
13 changes: 10 additions & 3 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,8 @@ static int flock_lock_file(struct file *filp, struct file_lock *request)
static int __posix_lock_file_conf(struct inode *inode, struct file_lock *request, struct file_lock *conflock)
{
struct file_lock *fl;
struct file_lock *new_fl, *new_fl2;
struct file_lock *new_fl = NULL;
struct file_lock *new_fl2 = NULL;
struct file_lock *left = NULL;
struct file_lock *right = NULL;
struct file_lock **before;
Expand All @@ -803,9 +804,15 @@ static int __posix_lock_file_conf(struct inode *inode, struct file_lock *request
/*
* We may need two file_lock structures for this operation,
* so we get them in advance to avoid races.
*
* In some cases we can be sure, that no new locks will be needed
*/
new_fl = locks_alloc_lock();
new_fl2 = locks_alloc_lock();
if (!(request->fl_flags & FL_ACCESS) &&
(request->fl_type != F_UNLCK ||
request->fl_start != 0 || request->fl_end != OFFSET_MAX)) {
new_fl = locks_alloc_lock();
new_fl2 = locks_alloc_lock();
}

lock_kernel();
if (request->fl_type != F_UNLCK) {
Expand Down

0 comments on commit 5ffa01b

Please sign in to comment.