On Tue, Aug 23, 2011 at 03:58:05PM -0700, Myklebust, Trond wrote: > > -----Original Message----- > > From: J. Bruce Fields [mailto:bfields@xxxxxxxxxxxx] > > diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h > > index 76f99e8..b875b03 100644 > > --- a/include/linux/nfs4.h > > +++ b/include/linux/nfs4.h > > @@ -373,6 +373,22 @@ enum nfsstat4 { > > NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked > */ > > }; > > > > +static inline bool seqid_mutating_err(u32 err) > > +{ > > + /* rfc 3530 section 8.1.5: */ > > + switch (err) { > > + case NFS4ERR_STALE_CLIENTID: > > + case NFS4ERR_STALE_STATEID: > > + case NFS4ERR_BAD_STATEID: > > + case NFS4ERR_BAD_SEQID: > > + case NFS4ERR_BADXDR: > > + case NFS4ERR_RESOURCE: > > + case NFS4ERR_NOFILEHANDLE: > > + return false; > > + }; > > + return true; > > +} > > + > > /* > > * Note: NF4BAD is not actually part of the protocol; it is just used > > * internally by nfsd. > > Should we make it take a 's32' rather than a 'u32' argument? We do > usually expect those errors to be signed. On the server side it's unsigned--bigendian in fact. The caller is: > > + if (seqid_mutating_err(ntohl(nfserr)) && stateowner) { \ I put this in nfs4.h which is mostly protocol constants, and I figure u32 is the type closest to the relevant xdr, and we should convert as necessary in callers. I dunno. --b. -- 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