1
0
Fork 0

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: a7d42ddb30 ("nfs: add mirroring support to pgio layer")
Cc: stable@vger.kernel.org # v4.0+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
steinar/wifi_calib_4_9_kernel
Trond Myklebust 2015-07-27 10:23:19 -04:00
parent 115c48d7a5
commit 03d5eb65b5
1 changed files with 4 additions and 1 deletions

View File

@ -1109,8 +1109,11 @@ static int nfs_do_recoalesce(struct nfs_pageio_descriptor *desc)
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);