summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust2016-12-07 18:29:26 +0100
committerTrond Myklebust2016-12-07 19:41:59 +0100
commit2f065ddb64193ebf9cd600395d4782287cd0f58e (patch)
tree3317f39d8df34fd64a5e8e47b47b14b91e61fe9f /fs/nfs/nfs4proc.c
parentpNFS/flexfiles: Fix ff_layout_add_ds_error_locked() (diff)
downloadkernel-qcow2-linux-2f065ddb64193ebf9cd600395d4782287cd0f58e.tar.gz
kernel-qcow2-linux-2f065ddb64193ebf9cd600395d4782287cd0f58e.tar.xz
kernel-qcow2-linux-2f065ddb64193ebf9cd600395d4782287cd0f58e.zip
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>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d3431ff32662..c5a508669655 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8641,10 +8641,10 @@ static void nfs4_layoutreturn_release(void *calldata)
pnfs_layoutreturn_free_lsegs(lo, &lrp->args.stateid, &lrp->args.range,
lrp->res.lrs_present ? &lrp->res.stateid : NULL);
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)
lrp->ld_private.ops->free(&lrp->ld_private);
+ pnfs_put_layout_hdr(lrp->args.layout);
+ nfs_iput_and_deactive(lrp->inode);
kfree(calldata);
dprintk("<-- %s\n", __func__);
}