mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
pNFS: Layoutreturn must free the layout after the layout-private data
The layout-private data may depend on the layout and/or the inode still existing when it does post-processing and frees its data, so we need to free them after calling lrp->ld_private.ops->free(). This fixes a mirror list corruption issue in the flexfiles driver. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
cb06793517
commit
2f065ddb64
1 changed files with 2 additions and 2 deletions
|
@ -8641,10 +8641,10 @@ static void nfs4_layoutreturn_release(void *calldata)
|
||||||
pnfs_layoutreturn_free_lsegs(lo, &lrp->args.stateid, &lrp->args.range,
|
pnfs_layoutreturn_free_lsegs(lo, &lrp->args.stateid, &lrp->args.range,
|
||||||
lrp->res.lrs_present ? &lrp->res.stateid : NULL);
|
lrp->res.lrs_present ? &lrp->res.stateid : NULL);
|
||||||
nfs4_sequence_free_slot(&lrp->res.seq_res);
|
nfs4_sequence_free_slot(&lrp->res.seq_res);
|
||||||
pnfs_put_layout_hdr(lrp->args.layout);
|
|
||||||
nfs_iput_and_deactive(lrp->inode);
|
|
||||||
if (lrp->ld_private.ops && lrp->ld_private.ops->free)
|
if (lrp->ld_private.ops && lrp->ld_private.ops->free)
|
||||||
lrp->ld_private.ops->free(&lrp->ld_private);
|
lrp->ld_private.ops->free(&lrp->ld_private);
|
||||||
|
pnfs_put_layout_hdr(lrp->args.layout);
|
||||||
|
nfs_iput_and_deactive(lrp->inode);
|
||||||
kfree(calldata);
|
kfree(calldata);
|
||||||
dprintk("<-- %s\n", __func__);
|
dprintk("<-- %s\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue