On 6/24/2015 5:34 AM, J. Bruce Fields wrote: > On Wed, Jun 17, 2015 at 09:57:34PM +0800, Kinglong Mee wrote: >> When testing pnfs layout, nfsd got error NFS4ERR_SEQ_MISORDERED. >> It is caused by nfs return NFS4ERR_DELAY before validate_seqid(), >> don't update the sequnce id, but nfsd updates the sequnce id !!! >> >> According to RFC5661 20.9.3, >> " If CB_SEQUENCE returns an error, then the state of the slot >> (sequence ID, cached reply) MUST NOT change." >> >> This patch introduce a new helper nfsd4_cb_sequence_done() for >> processing more callback errors as client. >> >> v2, >> thanks Christoph's advice of adding a helper process errors as client > > Thanks, could you rebase this on top of my for-4.2 branch? (I already > took your earlier patch.) Also: Got it. > >> Signed-off-by: Kinglong Mee <kinglongmee@xxxxxxxxx> >> --- >> fs/nfsd/nfs4callback.c | 122 +++++++++++++++++++++++++++++++++++++------------ >> fs/nfsd/state.h | 1 + >> 2 files changed, 93 insertions(+), 30 deletions(-) >> >> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c >> index ce8d3f2..6fce478 100644 >> --- a/fs/nfsd/nfs4callback.c >> +++ b/fs/nfsd/nfs4callback.c > ... >> @@ -874,6 +874,11 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata) >> struct nfs4_client *clp = cb->cb_clp; >> u32 minorversion = clp->cl_minorversion; >> >> + /* >> + * cb_seq_status is only set in decode_cb_sequence4res, >> + * and so will remain 1 if an rpc level failure occurs. >> + */ >> + cb->cb_seq_status = 1; > > Isn't that a valid error code? OK, I guess NFS4ERR_PERM isn't a legal > SEQUENCE return. Still, -1 might make this a bit more obvious. No, error code is a negative number, 1 is safe. Also, it is copied from client's error process in nfs41_sequence_done. thanks, Kinglong Mee -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html