[lkml]   [2005]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch 05/23] [PATCH] VFS: Fix memory leak with file leases
-stable review patch.  If anyone has any objections, please let us know.

The patch
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 <>
Signed-off-by: Trond Myklebust <>
Signed-off-by: Chris Wright <>
Signed-off-by: Greg Kroah-Hartman <>
fs/locks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-
+++ linux-
@@ -1418,7 +1418,7 @@ int fcntl_setlease(unsigned int fd, stru

error = __setlease(filp, arg, &flp);
- if (error)
+ if (error || arg == F_UNLCK)
goto out_unlock;

error = fasync_helper(fd, filp, 1, &flp->fl_fasync);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-11-22 22:21    [W:0.026 / U:8.260 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site