Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993668AbbHHWTg (ORCPT ); Sat, 8 Aug 2015 18:19:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36659 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2993168AbbHHWSO (ORCPT ); Sat, 8 Aug 2015 18:18:14 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust Subject: [PATCH 4.1 107/123] NFS: Fix a memory leak in nfs_do_recoalesce Date: Sat, 8 Aug 2015 15:09:45 -0700 Message-Id: <20150808220721.389542426@linuxfoundation.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <20150808220717.771230091@linuxfoundation.org> References: <20150808220717.771230091@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 42 4.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Trond Myklebust 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 Signed-off-by: Greg Kroah-Hartman --- 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/