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

Commit 45fcc7bc authored by Trond Myklebust's avatar Trond Myklebust
Browse files

pNFS: LAYOUTRETURN should only update the stateid if the layout is valid



If the layout was completely returned, then ignore the returned layout
stateid.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent dc05973b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8130,7 +8130,7 @@ static void nfs4_layoutreturn_release(void *calldata)
	pnfs_mark_matching_lsegs_invalid(lo, &freeme, &lrp->args.range,
			be32_to_cpu(lrp->args.stateid.seqid));
	pnfs_mark_layout_returned_if_empty(lo);
	if (lrp->res.lrs_present)
	if (lrp->res.lrs_present && pnfs_layout_is_valid(lo))
		pnfs_set_layout_stateid(lo, &lrp->res.stateid, true);
	pnfs_clear_layoutreturn_waitbit(lo);
	spin_unlock(&lo->plh_inode->i_lock);
+5 −0
Original line number Diff line number Diff line
@@ -375,6 +375,11 @@ static inline bool nfs_have_layout(struct inode *inode)
	return NFS_I(inode)->layout != NULL;
}

static inline bool pnfs_layout_is_valid(const struct pnfs_layout_hdr *lo)
{
	return test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags) == 0;
}

static inline struct nfs4_deviceid_node *
nfs4_get_deviceid(struct nfs4_deviceid_node *d)
{