From: "J. Bruce Fields" <bfields@fieldses.org>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd4: fix seqid_mutating_error
Date: Tue, 23 Aug 2011 21:22:48 -0400 [thread overview]
Message-ID: <20110824012248.GA26561@fieldses.org> (raw)
In-Reply-To: <2E1EB2CF9ED1CB4AA966F0EB76EAB4430AC9E4FB@SACMVEXC2-PRD.hq.netapp.com>
On Tue, Aug 23, 2011 at 03:58:05PM -0700, Myklebust, Trond wrote:
> > -----Original Message-----
> > From: J. Bruce Fields [mailto:bfields@fieldses.org]
> > 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.
next prev parent reply other threads:[~2011-08-24 1:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-19 17:24 [PATCH] nfsd4: fix seqid_mutating_error J. Bruce Fields
2011-08-19 21:12 ` Trond Myklebust
2011-08-23 21:41 ` J. Bruce Fields
2011-08-23 22:58 ` Myklebust, Trond
2011-08-24 1:22 ` J. Bruce Fields [this message]
2011-08-24 18:37 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110824012248.GA26561@fieldses.org \
--to=bfields@fieldses.org \
--cc=Trond.Myklebust@netapp.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox