diff options
author | J. Bruce Fields <bfields@fieldses.org> | 2005-11-11 01:08:00 +0100 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-11-13 18:29:54 +0100 |
commit | dc15ae14e97ee9d5ed740cbb0b94996076d8b37e (patch) | |
tree | a159edc76dedf81d73f17d844fbf965d5ded9f39 /fs/locks.c | |
parent | Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff) | |
download | linux-dc15ae14e97ee9d5ed740cbb0b94996076d8b37e.tar.xz linux-dc15ae14e97ee9d5ed740cbb0b94996076d8b37e.zip |
[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>
Diffstat (limited to 'fs/locks.c')
-rw-r--r-- | fs/locks.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/locks.c b/fs/locks.c index a1e8b2248014..600d1fbe3571 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -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); |