mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
[PATCH] VFS: Fix memory leak with file leases
The patch http://linux.bkbits.net:8080/linux-2.6/diffs/fs/locks.c@1.70??nav=index.html introduced a pretty nasty memory leak in the lease code. When freeing the lease, the code in locks_delete_lock() will correctly clean up the fasync queue, but when we return to fcntl_setlease(), the freed fasync entry will be reinstated. This patch ensures that we skip the call to fasync_helper() when we're freeing up the lease. Signed-off-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
9761be89f5
commit
b3834f71cb
1 changed files with 1 additions and 1 deletions
|
@ -1418,7 +1418,7 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
|
|||
lock_kernel();
|
||||
|
||||
error = __setlease(filp, arg, &flp);
|
||||
if (error)
|
||||
if (error || arg == F_UNLCK)
|
||||
goto out_unlock;
|
||||
|
||||
error = fasync_helper(fd, filp, 1, &flp->fl_fasync);
|
||||
|
|
Loading…
Reference in a new issue