提交 dc15ae14 编写于 作者: J J. Bruce Fields 提交者: Trond Myklebust

[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: NJ. Bruce Fields <bfields@fieldses.org>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 9e6c67fd
......@@ -1430,7 +1430,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册