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
a5210eec
Commit
a5210eec
authored
Mar 13, 2004
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Fix a list corruption in the NFSv4 state engine.
parent
8d2a4538
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
fs/nfs/inode.c
fs/nfs/inode.c
+2
-2
fs/nfs/nfs4state.c
fs/nfs/nfs4state.c
+15
-7
No files found.
fs/nfs/inode.c
View file @
a5210eec
...
@@ -1407,8 +1407,8 @@ static void nfs4_clear_inode(struct inode *inode)
...
@@ -1407,8 +1407,8 @@ static void nfs4_clear_inode(struct inode *inode)
inode
->
i_sb
->
s_id
,
inode
->
i_sb
->
s_id
,
(
long
long
)
NFS_FILEID
(
inode
),
(
long
long
)
NFS_FILEID
(
inode
),
state
);
state
);
list_del
(
&
state
->
inode_states
);
BUG_ON
(
atomic_read
(
&
state
->
count
)
!=
1
);
nfs4_
put_open_state
(
state
);
nfs4_
close_state
(
state
,
state
->
state
);
}
}
/* Now call standard NFS clear_inode() code */
/* Now call standard NFS clear_inode() code */
nfs_clear_inode
(
inode
);
nfs_clear_inode
(
inode
);
...
...
fs/nfs/nfs4state.c
View file @
a5210eec
...
@@ -411,18 +411,20 @@ nfs4_get_open_state(struct inode *inode, struct nfs4_state_owner *owner)
...
@@ -411,18 +411,20 @@ nfs4_get_open_state(struct inode *inode, struct nfs4_state_owner *owner)
return
state
;
return
state
;
}
}
void
static
void
nfs4_put_open_state
(
struct
nfs4_state
*
state
)
__
nfs4_put_open_state
(
struct
nfs4_state
*
state
)
{
{
struct
inode
*
inode
=
state
->
inode
;
struct
inode
*
inode
=
state
->
inode
;
struct
nfs4_state_owner
*
owner
=
state
->
owner
;
struct
nfs4_state_owner
*
owner
=
state
->
owner
;
int
status
=
0
;
int
status
=
0
;
if
(
!
atomic_dec_and_lock
(
&
state
->
count
,
&
inode
->
i_lock
))
if
(
!
atomic_dec_and_lock
(
&
state
->
count
,
&
inode
->
i_lock
))
{
up
(
&
owner
->
so_sema
);
return
;
return
;
}
if
(
!
list_empty
(
&
state
->
inode_states
))
list_del
(
&
state
->
inode_states
);
list_del
(
&
state
->
inode_states
);
spin_unlock
(
&
inode
->
i_lock
);
spin_unlock
(
&
inode
->
i_lock
);
down
(
&
owner
->
so_sema
);
list_del
(
&
state
->
open_states
);
list_del
(
&
state
->
open_states
);
if
(
state
->
state
!=
0
)
{
if
(
state
->
state
!=
0
)
{
do
{
do
{
...
@@ -439,6 +441,13 @@ nfs4_put_open_state(struct nfs4_state *state)
...
@@ -439,6 +441,13 @@ nfs4_put_open_state(struct nfs4_state *state)
nfs4_put_state_owner
(
owner
);
nfs4_put_state_owner
(
owner
);
}
}
void
nfs4_put_open_state
(
struct
nfs4_state
*
state
)
{
down
(
&
state
->
owner
->
so_sema
);
__nfs4_put_open_state
(
state
);
}
void
void
nfs4_close_state
(
struct
nfs4_state
*
state
,
mode_t
mode
)
nfs4_close_state
(
struct
nfs4_state
*
state
,
mode_t
mode
)
{
{
...
@@ -479,8 +488,7 @@ nfs4_close_state(struct nfs4_state *state, mode_t mode)
...
@@ -479,8 +488,7 @@ nfs4_close_state(struct nfs4_state *state, mode_t mode)
status
=
nfs4_handle_error
(
NFS_SERVER
(
inode
),
status
);
status
=
nfs4_handle_error
(
NFS_SERVER
(
inode
),
status
);
down
(
&
owner
->
so_sema
);
down
(
&
owner
->
so_sema
);
}
while
(
!
status
);
}
while
(
!
status
);
up
(
&
owner
->
so_sema
);
__nfs4_put_open_state
(
state
);
nfs4_put_open_state
(
state
);
}
}
/*
/*
...
...
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