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
7a8711c9
Commit
7a8711c9
authored
Sep 02, 2011
by
J. Bruce Fields
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd4: share common seqid checks
Signed-off-by:
J. Bruce Fields
<
bfields@redhat.com
>
parent
16d25941
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
fs/nfsd/nfs4state.c
fs/nfsd/nfs4state.c
+21
-20
No files found.
fs/nfsd/nfs4state.c
View file @
7a8711c9
...
...
@@ -2456,6 +2456,16 @@ static const struct lock_manager_operations nfsd_lease_mng_ops = {
.
lm_change
=
nfsd_change_deleg_cb
,
};
static
__be32
nfsd4_check_seqid
(
struct
nfsd4_compound_state
*
cstate
,
struct
nfs4_stateowner
*
so
,
u32
seqid
)
{
if
(
nfsd4_has_session
(
cstate
))
return
nfs_ok
;
if
(
seqid
==
so
->
so_seqid
-
1
)
return
nfserr_replay_me
;
if
(
seqid
==
so
->
so_seqid
)
return
nfs_ok
;
return
nfserr_bad_seqid
;
}
__be32
nfsd4_process_open1
(
struct
nfsd4_compound_state
*
cstate
,
...
...
@@ -2465,6 +2475,7 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate,
struct
nfs4_client
*
clp
=
NULL
;
unsigned
int
strhashval
;
struct
nfs4_stateowner
*
sop
=
NULL
;
__be32
status
;
if
(
!
check_name
(
open
->
op_owner
))
return
nfserr_inval
;
...
...
@@ -2482,9 +2493,6 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate,
return
nfserr_expired
;
goto
renew
;
}
/* When sessions are used, skip open sequenceid processing */
if
(
nfsd4_has_session
(
cstate
))
goto
renew
;
if
(
!
sop
->
so_confirmed
)
{
/* Replace unconfirmed owners without checking for replay. */
clp
=
sop
->
so_client
;
...
...
@@ -2492,10 +2500,9 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate,
open
->
op_stateowner
=
NULL
;
goto
renew
;
}
if
(
open
->
op_seqid
==
sop
->
so_seqid
-
1
)
return
nfserr_replay_me
;
if
(
open
->
op_seqid
!=
sop
->
so_seqid
)
return
nfserr_bad_seqid
;
status
=
nfsd4_check_seqid
(
cstate
,
sop
,
open
->
op_seqid
);
if
(
status
)
return
status
;
renew:
if
(
open
->
op_stateowner
==
NULL
)
{
sop
=
alloc_init_open_stateowner
(
strhashval
,
clp
,
open
);
...
...
@@ -3411,7 +3418,10 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
if
(
sop
==
NULL
)
return
nfserr_expired
;
cstate
->
replay_owner
=
sop
;
goto
check_replay
;
status
=
nfsd4_check_seqid
(
cstate
,
sop
,
seqid
);
if
(
status
)
return
status
;
return
nfserr_bad_seqid
;
}
*
stpp
=
stp
;
...
...
@@ -3423,8 +3433,9 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
return
nfserr_bad_stateid
;
}
if
(
!
nfsd4_has_session
(
cstate
)
&&
seqid
!=
sop
->
so_seqid
)
goto
check_replay
;
status
=
nfsd4_check_seqid
(
cstate
,
sop
,
seqid
);
if
(
status
)
return
status
;
if
(
sop
->
so_confirmed
&&
flags
&
CONFIRM
)
{
dprintk
(
"NFSD: preprocess_seqid_op: expected"
...
...
@@ -3441,16 +3452,6 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
return
status
;
renew_client
(
sop
->
so_client
);
return
nfs_ok
;
check_replay:
if
(
seqid
==
sop
->
so_seqid
-
1
)
{
dprintk
(
"NFSD: preprocess_seqid_op: retransmission?
\n
"
);
/* indicate replay to calling function */
return
nfserr_replay_me
;
}
dprintk
(
"NFSD: preprocess_seqid_op: bad seqid (expected %d, got %d)
\n
"
,
sop
->
so_seqid
,
seqid
);
return
nfserr_bad_seqid
;
}
__be32
...
...
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