Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8896b93f authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

locks: remove dead lease error-handling code



A minor oversight from f7347ce4,
"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: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 3df057ac
Loading
Loading
Loading
Loading
+2 −10
Original line number Original line Diff line number Diff line
@@ -1506,7 +1506,6 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
{
{
	struct file_lock *fl, *ret;
	struct file_lock *fl, *ret;
	struct fasync_struct *new;
	struct fasync_struct *new;
	struct inode *inode = filp->f_path.dentry->d_inode;
	int error;
	int error;


	fl = lease_alloc(filp, arg);
	fl = lease_alloc(filp, arg);
@@ -1520,7 +1519,7 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
	}
	}
	ret = fl;
	ret = fl;
	lock_flocks();
	lock_flocks();
	error = __vfs_setlease(filp, arg, &fl);
	error = __vfs_setlease(filp, arg, &ret);
	if (error) {
	if (error) {
		unlock_flocks();
		unlock_flocks();
		locks_free_lock(fl);
		locks_free_lock(fl);
@@ -1538,14 +1537,7 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
	if (!fasync_insert_entry(fd, filp, &ret->fl_fasync, new))
	if (!fasync_insert_entry(fd, filp, &ret->fl_fasync, new))
		new = NULL;
		new = NULL;


	if (error < 0) {
		/* remove lease just inserted by setlease */
		fl->fl_type = F_UNLCK | F_INPROGRESS;
		fl->fl_break_time = jiffies - 10;
		time_out_leases(inode);
	} else {
	error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
	error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
	}
	unlock_flocks();
	unlock_flocks();


out_free_fasync:
out_free_fasync: