pNFS: Retry NFS4ERR_OLD_STATEID errors in layoutreturn-on-close

If our layoutreturn on close operation returns an NFS4ERR_OLD_STATEID,
then try to update the stateid and retry. We know that there should
be no further LAYOUTGET requests being launched.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Trond Myklebust
2017-11-06 15:28:07 -05:00
committed by Anna Schumaker
parent c82bac6f4b
commit 7380020e77
3 changed files with 40 additions and 2 deletions

View File

@@ -354,6 +354,24 @@ pnfs_clear_lseg_state(struct pnfs_layout_segment *lseg,
pnfs_lseg_dec_and_remove_zero(lseg, free_me);
}
/*
* Update the seqid of a layout stateid
*/
bool nfs4_refresh_layout_stateid(nfs4_stateid *dst, struct inode *inode)
{
struct pnfs_layout_hdr *lo;
bool ret = false;
spin_lock(&inode->i_lock);
lo = NFS_I(inode)->layout;
if (lo && nfs4_stateid_match_other(dst, &lo->plh_stateid)) {
dst->seqid = lo->plh_stateid.seqid;
ret = true;
}
spin_unlock(&inode->i_lock);
return ret;
}
/*
* Mark a pnfs_layout_hdr and all associated layout segments as invalid
*