Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a9004abc
Commit
a9004abc
authored
Aug 23, 2011
by
J. Bruce Fields
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd4: cleanup and consolidate seqid_mutating_err
Signed-off-by:
J. Bruce Fields
<
bfields@redhat.com
>
parent
28dde241
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
37 deletions
+17
-37
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+0
-24
fs/nfsd/nfs4xdr.c
fs/nfsd/nfs4xdr.c
+1
-13
include/linux/nfs4.h
include/linux/nfs4.h
+16
-0
No files found.
fs/nfs/nfs4_fs.h
View file @
a9004abc
...
...
@@ -13,30 +13,6 @@
struct
idmap
;
/*
* In a seqid-mutating op, this macro controls which error return
* values trigger incrementation of the seqid.
*
* from rfc 3010:
* The client MUST monotonically increment the sequence number for the
* CLOSE, LOCK, LOCKU, OPEN, OPEN_CONFIRM, and OPEN_DOWNGRADE
* operations. This is true even in the event that the previous
* operation that used the sequence number received an error. The only
* exception to this rule is if the previous operation received one of
* the following errors: NFSERR_STALE_CLIENTID, NFSERR_STALE_STATEID,
* NFSERR_BAD_STATEID, NFSERR_BAD_SEQID, NFSERR_BADXDR,
* NFSERR_RESOURCE, NFSERR_NOFILEHANDLE.
*
*/
#define seqid_mutating_err(err) \
(((err) != NFSERR_STALE_CLIENTID) && \
((err) != NFSERR_STALE_STATEID) && \
((err) != NFSERR_BAD_STATEID) && \
((err) != NFSERR_BAD_SEQID) && \
((err) != NFSERR_BAD_XDR) && \
((err) != NFSERR_RESOURCE) && \
((err) != NFSERR_NOFILEHANDLE))
enum
nfs4_client_state
{
NFS4CLNT_MANAGER_RUNNING
=
0
,
NFS4CLNT_CHECK_LEASE
,
...
...
fs/nfsd/nfs4xdr.c
View file @
a9004abc
...
...
@@ -1623,18 +1623,6 @@ static void write_cinfo(__be32 **p, struct nfsd4_change_info *c)
\
save = resp->p;
static
bool
seqid_mutating_err
(
__be32
err
)
{
/* rfc 3530 section 8.1.5: */
return
err
!=
nfserr_stale_clientid
&&
err
!=
nfserr_stale_stateid
&&
err
!=
nfserr_bad_stateid
&&
err
!=
nfserr_bad_seqid
&&
err
!=
nfserr_bad_xdr
&&
err
!=
nfserr_resource
&&
err
!=
nfserr_nofilehandle
;
}
/*
* Routine for encoding the result of a "seqid-mutating" NFSv4 operation. This
* is where sequence id's are incremented, and the replay cache is filled.
...
...
@@ -1643,7 +1631,7 @@ static bool seqid_mutating_err(__be32 err)
*/
#define ENCODE_SEQID_OP_TAIL(stateowner) do { \
if (seqid_mutating_err(n
fserr
) && stateowner) { \
if (seqid_mutating_err(n
tohl(nfserr)
) && stateowner) { \
stateowner->so_seqid++; \
stateowner->so_replay.rp_status = nfserr; \
stateowner->so_replay.rp_buflen = \
...
...
include/linux/nfs4.h
View file @
a9004abc
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment