Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221745
b: refs/heads/master
c: 3df057a
h: refs/heads/master
i:
  221743: 7da4d66
v: v3
  • Loading branch information
J. Bruce Fields committed Nov 10, 2010
1 parent 9c330ac commit bc9a8c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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: 21b75b019983dfa5c2dda588f4b60b4ca69844a4
refs/heads/master: 3df057ac9afe83c4af84016df3baf3a0eb1d3d33
7 changes: 5 additions & 2 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ static int do_fcntl_delete_lease(struct file *filp)

static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
{
struct file_lock *fl;
struct file_lock *fl, *ret;
struct fasync_struct *new;
struct inode *inode = filp->f_path.dentry->d_inode;
int error;
Expand All @@ -1518,21 +1518,24 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
locks_free_lock(fl);
return -ENOMEM;
}
ret = fl;
lock_flocks();
error = __vfs_setlease(filp, arg, &fl);
if (error) {
unlock_flocks();
locks_free_lock(fl);
goto out_free_fasync;
}
if (ret != fl)
locks_free_lock(fl);

/*
* fasync_insert_entry() returns the old entry if any.
* If there was no old entry, then it used 'new' and
* inserted it into the fasync list. Clear new so that
* we don't release it here.
*/
if (!fasync_insert_entry(fd, filp, &fl->fl_fasync, new))
if (!fasync_insert_entry(fd, filp, &ret->fl_fasync, new))
new = NULL;

if (error < 0) {
Expand Down

0 comments on commit bc9a8c4

Please sign in to comment.