Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9928
b: refs/heads/master
c: 449231d
h: refs/heads/master
v: v3
  • Loading branch information
Olaf Kirch authored and Trond Myklebust committed Sep 23, 2005
1 parent 6b4d249 commit 0ced571
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 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: 20509f1bc553ed7fafa88fa8d01c6212d1876d9f
refs/heads/master: 449231d6ddf50ca46b7fb2f76ecf790135222913
6 changes: 5 additions & 1 deletion trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,12 +829,16 @@ static int __posix_lock_file(struct inode *inode, struct file_lock *request)
/* Detect adjacent or overlapping regions (if same lock type)
*/
if (request->fl_type == fl->fl_type) {
/* In all comparisons of start vs end, use
* "start - 1" rather than "end + 1". If end
* is OFFSET_MAX, end + 1 will become negative.
*/
if (fl->fl_end < request->fl_start - 1)
goto next_lock;
/* If the next lock in the list has entirely bigger
* addresses than the new one, insert the lock here.
*/
if (fl->fl_start > request->fl_end + 1)
if (fl->fl_start - 1 > request->fl_end)
break;

/* If we come here, the new and old lock are of the
Expand Down

0 comments on commit 0ced571

Please sign in to comment.