Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92967
b: refs/heads/master
c: 288b2fd
h: refs/heads/master
i:
  92965: bdb48f5
  92963: f610c56
  92959: e8b9fc7
v: v3
  • Loading branch information
David M. Richter authored and J. Bruce Fields committed Apr 25, 2008
1 parent 179f7a4 commit c82d74c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 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: 5fcc60c3a05bf417229fba715e7aec52bf6717fb
refs/heads/master: 288b2fd8251cb0bcb14b8a93755ef9c78de70e0f
24 changes: 13 additions & 11 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,18 +1367,20 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp)

lease = *flp;

error = -EAGAIN;
if ((arg == F_RDLCK) && (atomic_read(&inode->i_writecount) > 0))
goto out;
if ((arg == F_WRLCK)
&& ((atomic_read(&dentry->d_count) > 1)
|| (atomic_read(&inode->i_count) > 1)))
goto out;
if (arg != F_UNLCK) {
error = -EAGAIN;
if ((arg == F_RDLCK) && (atomic_read(&inode->i_writecount) > 0))
goto out;
if ((arg == F_WRLCK)
&& ((atomic_read(&dentry->d_count) > 1)
|| (atomic_read(&inode->i_count) > 1)))
goto out;

error = -ENOMEM;
new_fl = locks_alloc_lock();
if (new_fl == NULL)
goto out;
error = -ENOMEM;
new_fl = locks_alloc_lock();
if (new_fl == NULL)
goto out;
}

/*
* At this point, we know that if there is an exclusive
Expand Down

0 comments on commit c82d74c

Please sign in to comment.