aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-09-03 11:05:28 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-09-03 12:10:38 -0400
commit52ec7be2e27392201adf77892ba883f68df88c99 (patch)
tree38eb70caf7be589aedc17912673d1a09d3539cff
parent2a59a0411671ef9daf17ba21da57809c696f4119 (diff)
pNFS: Clear out all layout segments if the server unsets lrp->res.lrs_present
If the server fails to set lrp->res.lrs_present in the LAYOUTRETURN reply, then that means it believes the client holds no more layout state for that file, and that the layout stateid is now invalid. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r--fs/nfs/nfs4proc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f5aecaabcb7c..c380d2ee4137 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8190,10 +8190,13 @@ static void nfs4_layoutreturn_release(void *calldata)
8190 8190
8191 dprintk("--> %s\n", __func__); 8191 dprintk("--> %s\n", __func__);
8192 spin_lock(&lo->plh_inode->i_lock); 8192 spin_lock(&lo->plh_inode->i_lock);
8193 pnfs_mark_matching_lsegs_invalid(lo, &freeme, &lrp->args.range, 8193 if (lrp->res.lrs_present) {
8194 be32_to_cpu(lrp->args.stateid.seqid)); 8194 pnfs_mark_matching_lsegs_invalid(lo, &freeme,
8195 if (lrp->res.lrs_present && pnfs_layout_is_valid(lo)) 8195 &lrp->args.range,
8196 be32_to_cpu(lrp->args.stateid.seqid));
8196 pnfs_set_layout_stateid(lo, &lrp->res.stateid, true); 8197 pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
8198 } else
8199 pnfs_mark_layout_stateid_invalid(lo, &freeme);
8197 pnfs_clear_layoutreturn_waitbit(lo); 8200 pnfs_clear_layoutreturn_waitbit(lo);
8198 spin_unlock(&lo->plh_inode->i_lock); 8201 spin_unlock(&lo->plh_inode->i_lock);
8199 nfs4_sequence_free_slot(&lrp->res.seq_res); 8202 nfs4_sequence_free_slot(&lrp->res.seq_res);