From: Chris Wright Date: Mon, 14 Nov 2005 18:23:16 +0000 (-0800) Subject: File leases memory leak fix from J. Bruce Fields. X-Git-Tag: v2.6.14.3~12^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=711e9eea52058afe6948884b6f20c170aea2a1ed;p=thirdparty%2Fkernel%2Fstable-queue.git File leases memory leak fix from J. Bruce Fields. --- diff --git a/queue/fix-memory-leak-with-file-leases.patch b/queue/fix-memory-leak-with-file-leases.patch new file mode 100644 index 00000000000..80b32c4ed18 --- /dev/null +++ b/queue/fix-memory-leak-with-file-leases.patch @@ -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 +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 +Signed-off-by: Trond Myklebust +Signed-off-by: Chris Wright +--- + + 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); diff --git a/queue/series b/queue/series index 3d21def76e2..6ebf15e4bf3 100644 --- a/queue/series +++ b/queue/series @@ -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