stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "NFS: Fix a memory leak in nfs_do_recoalesce" has been added to the 4.1-stable tree
@ 2015-08-08 22:02 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-08-08 22:02 UTC (permalink / raw)
  To: trond.myklebust, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    NFS: Fix a memory leak in nfs_do_recoalesce

to the 4.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfs-fix-a-memory-leak-in-nfs_do_recoalesce.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 03d5eb65b53889fe98a5ecddfe205c16e3093190 Mon Sep 17 00:00:00 2001
From: Trond Myklebust <trond.myklebust@primarydata.com>
Date: Mon, 27 Jul 2015 10:23:19 -0400
Subject: NFS: Fix a memory leak in nfs_do_recoalesce

From: Trond Myklebust <trond.myklebust@primarydata.com>

commit 03d5eb65b53889fe98a5ecddfe205c16e3093190 upstream.

If the function exits early, then we must put those requests that were
not processed back onto the &mirror->pg_list so they can be cleaned up
by nfs_pgio_error().

Fixes: a7d42ddb30997 ("nfs: add mirroring support to pgio layer")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/nfs/pagelist.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -1110,8 +1110,11 @@ static int nfs_do_recoalesce(struct nfs_
 			nfs_list_remove_request(req);
 			if (__nfs_pageio_add_request(desc, req))
 				continue;
-			if (desc->pg_error < 0)
+			if (desc->pg_error < 0) {
+				list_splice_tail(&head, &mirror->pg_list);
+				mirror->pg_recoalesce = 1;
 				return 0;
+			}
 			break;
 		}
 	} while (mirror->pg_recoalesce);


Patches currently in stable-queue which might be from trond.myklebust@primarydata.com are

queue-4.1/nfsv4-we-must-set-nfs_open_state-flag-in-nfs_resync_open_stateid_locked.patch
queue-4.1/nfs-fix-a-memory-leak-in-nfs_do_recoalesce.patch
queue-4.1/nfs-don-t-revalidate-the-mapping-if-both-size-and-change-attr-are-up-to-date.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-08 22:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-08 22:02 Patch "NFS: Fix a memory leak in nfs_do_recoalesce" has been added to the 4.1-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).