diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-07-27 10:23:19 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-07-27 10:33:08 -0400 |
commit | 03d5eb65b53889fe98a5ecddfe205c16e3093190 (patch) | |
tree | 9fbd7052c8f5663170d119ac94a0d2a6a00dd392 | |
parent | 115c48d7a5351abeadd0c8a3dc87eca3d66a6475 (diff) |
NFS: Fix a memory leak in nfs_do_recoalesce
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")
Cc: stable@vger.kernel.org # v4.0+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/pagelist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 1da68d3b1eda..8ea5920fb777 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
@@ -1109,8 +1109,11 @@ static int nfs_do_recoalesce(struct nfs_pageio_descriptor *desc) | |||
1109 | nfs_list_remove_request(req); | 1109 | nfs_list_remove_request(req); |
1110 | if (__nfs_pageio_add_request(desc, req)) | 1110 | if (__nfs_pageio_add_request(desc, req)) |
1111 | continue; | 1111 | continue; |
1112 | if (desc->pg_error < 0) | 1112 | if (desc->pg_error < 0) { |
1113 | list_splice_tail(&head, &mirror->pg_list); | ||
1114 | mirror->pg_recoalesce = 1; | ||
1113 | return 0; | 1115 | return 0; |
1116 | } | ||
1114 | break; | 1117 | break; |
1115 | } | 1118 | } |
1116 | } while (mirror->pg_recoalesce); | 1119 | } while (mirror->pg_recoalesce); |