/[linux-patches]/genpatches-2.6/trunk/2.6.14/1118_3_file-lease-leak.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1118_3_file-lease-leak.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 214 - (show annotations) (download) (as text)
Fri Nov 25 00:35:16 2005 UTC (15 years ago) by dsd
Original Path: genpatches-2.6/trunk/2.6.14/1018_3_file-lease-leak.patch
File MIME type: text/x-diff
File size: 1173 byte(s)
Linux 2.6.14.3
1 From nobody Mon Sep 17 00:00:00 2001
2 Subject: [PATCH] VFS: Fix memory leak with file leases
3 From: J. Bruce Fields <bfields@fieldses.org>
4 Date: 1131667680 -0500
5
6 The patch
7 http://linux.bkbits.net:8080/linux-2.6/diffs/fs/locks.c@1.70??nav=index.html
8 introduced a pretty nasty memory leak in the lease code. When freeing
9 the lease, the code in locks_delete_lock() will correctly clean up
10 the fasync queue, but when we return to fcntl_setlease(), the freed
11 fasync entry will be reinstated.
12
13 This patch ensures that we skip the call to fasync_helper() when we're
14 freeing up the lease.
15
16 Signed-off-by: J. Bruce Fields <bfields@fieldses.org>
17 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
18 Signed-off-by: Chris Wright <chrisw@osdl.org>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20 ---
21 fs/locks.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 --- linux-2.6.14.2.orig/fs/locks.c
25 +++ linux-2.6.14.2/fs/locks.c
26 @@ -1418,7 +1418,7 @@ int fcntl_setlease(unsigned int fd, stru
27 lock_kernel();
28
29 error = __setlease(filp, arg, &flp);
30 - if (error)
31 + if (error || arg == F_UNLCK)
32 goto out_unlock;
33
34 error = fasync_helper(fd, filp, 1, &flp->fl_fasync);

  ViewVC Help
Powered by ViewVC 1.1.20