aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2010-11-03 18:09:18 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-11-10 14:31:29 -0500
commit8896b93f42459b18b145c69d399b62870df48061 (patch)
tree661b82f867391d16345c75b693f29b24c062d478
parent3df057ac9afe83c4af84016df3baf3a0eb1d3d33 (diff)
locks: remove dead lease error-handling code
A minor oversight from f7347ce4ee7c65415f84be915c018473e7076f31, "fasync: re-organize fasync entry insertion to allow it under a spinlock": this cleanup-on-error was only needed to handle -ENOMEM. Now that we're preallocating it's unneeded. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/locks.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 61c22f722050..0e62dd35d088 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1506,7 +1506,6 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
1506{ 1506{
1507 struct file_lock *fl, *ret; 1507 struct file_lock *fl, *ret;
1508 struct fasync_struct *new; 1508 struct fasync_struct *new;
1509 struct inode *inode = filp->f_path.dentry->d_inode;
1510 int error; 1509 int error;
1511 1510
1512 fl = lease_alloc(filp, arg); 1511 fl = lease_alloc(filp, arg);
@@ -1520,7 +1519,7 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
1520 } 1519 }
1521 ret = fl; 1520 ret = fl;
1522 lock_flocks(); 1521 lock_flocks();
1523 error = __vfs_setlease(filp, arg, &fl); 1522 error = __vfs_setlease(filp, arg, &ret);
1524 if (error) { 1523 if (error) {
1525 unlock_flocks(); 1524 unlock_flocks();
1526 locks_free_lock(fl); 1525 locks_free_lock(fl);
@@ -1538,14 +1537,7 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
1538 if (!fasync_insert_entry(fd, filp, &ret->fl_fasync, new)) 1537 if (!fasync_insert_entry(fd, filp, &ret->fl_fasync, new))
1539 new = NULL; 1538 new = NULL;
1540 1539
1541 if (error < 0) { 1540 error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
1542 /* remove lease just inserted by setlease */
1543 fl->fl_type = F_UNLCK | F_INPROGRESS;
1544 fl->fl_break_time = jiffies - 10;
1545 time_out_leases(inode);
1546 } else {
1547 error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
1548 }
1549 unlock_flocks(); 1541 unlock_flocks();
1550 1542
1551out_free_fasync: 1543out_free_fasync: