Commit 862f35c94730c9270833f3ad05bd758a29f204ed

Authored by Trond Myklebust
1 parent f02cec9d33

NFS: Fix memory leaks in nfs_pageio_stop_mirroring()

If we just set the mirror count to 1 without first clearing out
the mirrors, we can leak queued up requests.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

Showing 1 changed file with 8 additions and 9 deletions Side-by-side Diff

... ... @@ -900,15 +900,6 @@
900 900 pgio->pg_mirror_count = mirror_count;
901 901 }
902 902  
903   -/*
904   - * nfs_pageio_stop_mirroring - stop using mirroring (set mirror count to 1)
905   - */
906   -void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio)
907   -{
908   - pgio->pg_mirror_count = 1;
909   - pgio->pg_mirror_idx = 0;
910   -}
911   -
912 903 static void nfs_pageio_cleanup_mirroring(struct nfs_pageio_descriptor *pgio)
913 904 {
914 905 pgio->pg_mirror_count = 1;
... ... @@ -1332,6 +1323,14 @@
1332 1323 }
1333 1324 }
1334 1325 }
  1326 +}
  1327 +
  1328 +/*
  1329 + * nfs_pageio_stop_mirroring - stop using mirroring (set mirror count to 1)
  1330 + */
  1331 +void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio)
  1332 +{
  1333 + nfs_pageio_complete(pgio);
1335 1334 }
1336 1335  
1337 1336 int __init nfs_init_nfspagecache(void)