Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277012
b: refs/heads/master
c: 6d4b9e3
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Dec 26, 2011
1 parent 58c0d18 commit c65c891
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 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: 4962516b2309d76964f9df0d33e74f43b624a42d
refs/heads/master: 6d4b9e38d3980826abccfbd90e95bf4bd41b8dd2
11 changes: 3 additions & 8 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,8 @@ int __break_lease(struct inode *inode, unsigned int mode)
int want_write = (mode & O_ACCMODE) != O_RDONLY;

new_fl = lease_alloc(NULL, want_write ? F_WRLCK : F_RDLCK);
if (IS_ERR(new_fl))
return PTR_ERR(new_fl);

lock_flocks();

Expand All @@ -1221,12 +1223,6 @@ int __break_lease(struct inode *inode, unsigned int mode)
if (fl->fl_owner == current->files)
i_have_this_lease = 1;

if (IS_ERR(new_fl) && !i_have_this_lease
&& ((mode & O_NONBLOCK) == 0)) {
error = PTR_ERR(new_fl);
goto out;
}

break_time = 0;
if (lease_break_time > 0) {
break_time = jiffies + lease_break_time * HZ;
Expand Down Expand Up @@ -1284,8 +1280,7 @@ int __break_lease(struct inode *inode, unsigned int mode)

out:
unlock_flocks();
if (!IS_ERR(new_fl))
locks_free_lock(new_fl);
locks_free_lock(new_fl);
return error;
}

Expand Down

0 comments on commit c65c891

Please sign in to comment.