提交 2dfb928f 编写于 作者: J Jeff Layton

locks: move locks_free_lock calls in do_fcntl_add_lease outside spinlock

There's no need to call locks_free_lock here while still holding the
i_lock. Defer that until the lock has been dropped.
Acked-by: NJ. Bruce Fields <bfields@fieldses.org>
Signed-off-by: NJeff Layton <jlayton@primarydata.com>
上级 ed9814d8
...@@ -1761,13 +1761,10 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg) ...@@ -1761,13 +1761,10 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
ret = fl; ret = fl;
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
error = __vfs_setlease(filp, arg, &ret); error = __vfs_setlease(filp, arg, &ret);
if (error) { if (error)
spin_unlock(&inode->i_lock); goto out_unlock;
locks_free_lock(fl); if (ret == fl)
goto out_free_fasync; fl = NULL;
}
if (ret != fl)
locks_free_lock(fl);
/* /*
* fasync_insert_entry() returns the old entry if any. * fasync_insert_entry() returns the old entry if any.
...@@ -1779,9 +1776,10 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg) ...@@ -1779,9 +1776,10 @@ static int do_fcntl_add_lease(unsigned int fd, struct file *filp, long arg)
new = NULL; new = NULL;
error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0); error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
out_unlock:
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
if (fl)
out_free_fasync: locks_free_lock(fl);
if (new) if (new)
fasync_free(new); fasync_free(new);
return error; return error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册