]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
File leases memory leak fix from J. Bruce Fields.
authorChris Wright <chrisw@osdl.org>
Mon, 14 Nov 2005 18:23:16 +0000 (10:23 -0800)
committerChris Wright <chrisw@osdl.org>
Mon, 14 Nov 2005 18:23:16 +0000 (10:23 -0800)
queue/fix-memory-leak-with-file-leases.patch [new file with mode: 0644]
queue/series

diff --git a/queue/fix-memory-leak-with-file-leases.patch b/queue/fix-memory-leak-with-file-leases.patch
new file mode 100644 (file)
index 0000000..80b32c4
--- /dev/null
@@ -0,0 +1,36 @@
+From nobody Mon Sep 17 00:00:00 2001
+Subject: [PATCH] VFS: Fix memory leak with file leases
+From: J. Bruce Fields <bfields@fieldses.org>
+Date: 1131667680 -0500
+
+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>
+---
+
+ fs/locks.c |    2 +-
+ 1 files changed, 1 insertion(+), 1 deletion(-)
+
+Index: linux-2.6.14.y/fs/locks.c
+===================================================================
+--- linux-2.6.14.y.orig/fs/locks.c
++++ linux-2.6.14.y/fs/locks.c
+@@ -1418,7 +1418,7 @@ int fcntl_setlease(unsigned int fd, stru
+       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);
index 3d21def76e2bb02a2fed94d743bad9eaa01cbc60..6ebf15e4bf3926a2dd4b28ffec6003af6d5c268e 100644 (file)
@@ -2,3 +2,4 @@ ppc64-memory-model-depends-on-NUMA.patch
 ptrace-auto-reap-fix.patch
 fix-soft-lockup-with-ALSA-rtc-timer.patch
 packet-writing-oops-fix.patch
+fix-memory-leak-with-file-leases.patch