Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52ec7be2 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

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: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 2a59a041
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -8190,10 +8190,13 @@ static void nfs4_layoutreturn_release(void *calldata)


	dprintk("--> %s\n", __func__);
	dprintk("--> %s\n", __func__);
	spin_lock(&lo->plh_inode->i_lock);
	spin_lock(&lo->plh_inode->i_lock);
	pnfs_mark_matching_lsegs_invalid(lo, &freeme, &lrp->args.range,
	if (lrp->res.lrs_present) {
		pnfs_mark_matching_lsegs_invalid(lo, &freeme,
				&lrp->args.range,
				be32_to_cpu(lrp->args.stateid.seqid));
				be32_to_cpu(lrp->args.stateid.seqid));
	if (lrp->res.lrs_present && pnfs_layout_is_valid(lo))
		pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
		pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
	} else
		pnfs_mark_layout_stateid_invalid(lo, &freeme);
	pnfs_clear_layoutreturn_waitbit(lo);
	pnfs_clear_layoutreturn_waitbit(lo);
	spin_unlock(&lo->plh_inode->i_lock);
	spin_unlock(&lo->plh_inode->i_lock);
	nfs4_sequence_free_slot(&lrp->res.seq_res);
	nfs4_sequence_free_slot(&lrp->res.seq_res);