mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 01:34:00 +08:00
NFS: Do cleanup before resetting pageio read/write to mds
There is a reference leak of layout segment after resetting pageio read/write to mds. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Cc: stable@vger.kernel.org # v4.0+ Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
4b0ab51db3
commit
6f29b9bba7
@ -72,6 +72,9 @@ void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio)
|
||||
{
|
||||
struct nfs_pgio_mirror *mirror;
|
||||
|
||||
if (pgio->pg_ops && pgio->pg_ops->pg_cleanup)
|
||||
pgio->pg_ops->pg_cleanup(pgio);
|
||||
|
||||
pgio->pg_ops = &nfs_pgio_rw_ops;
|
||||
|
||||
/* read path should never have more than one mirror */
|
||||
|
@ -1351,6 +1351,9 @@ void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio)
|
||||
{
|
||||
struct nfs_pgio_mirror *mirror;
|
||||
|
||||
if (pgio->pg_ops && pgio->pg_ops->pg_cleanup)
|
||||
pgio->pg_ops->pg_cleanup(pgio);
|
||||
|
||||
pgio->pg_ops = &nfs_pgio_rw_ops;
|
||||
|
||||
nfs_pageio_stop_mirroring(pgio);
|
||||
|
Loading…
Reference in New Issue
Block a user