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
Kirill Smelkov
linux
Commits
aa5190d0
Commit
aa5190d0
authored
Jun 16, 2010
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Kill nfs4_async_handle_error() abuses by NFSv4.1
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
d185a334
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
37 deletions
+41
-37
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+41
-37
No files found.
fs/nfs/nfs4proc.c
View file @
aa5190d0
...
@@ -3457,9 +3457,11 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen
...
@@ -3457,9 +3457,11 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen
}
}
static
int
static
int
_nfs4_async_handle_error
(
struct
rpc_task
*
task
,
const
struct
nfs_server
*
server
,
struct
nfs_client
*
clp
,
struct
nfs4_state
*
state
)
nfs4_async_handle_error
(
struct
rpc_task
*
task
,
const
struct
nfs_server
*
server
,
struct
nfs4_state
*
state
)
{
{
if
(
!
clp
||
task
->
tk_status
>=
0
)
struct
nfs_client
*
clp
=
server
->
nfs_client
;
if
(
task
->
tk_status
>=
0
)
return
0
;
return
0
;
switch
(
task
->
tk_status
)
{
switch
(
task
->
tk_status
)
{
case
-
NFS4ERR_ADMIN_REVOKED
:
case
-
NFS4ERR_ADMIN_REVOKED
:
...
@@ -3491,7 +3493,6 @@ _nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
...
@@ -3491,7 +3493,6 @@ _nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
return
-
EAGAIN
;
return
-
EAGAIN
;
#endif
/* CONFIG_NFS_V4_1 */
#endif
/* CONFIG_NFS_V4_1 */
case
-
NFS4ERR_DELAY
:
case
-
NFS4ERR_DELAY
:
if
(
server
)
nfs_inc_server_stats
(
server
,
NFSIOS_DELAY
);
nfs_inc_server_stats
(
server
,
NFSIOS_DELAY
);
case
-
NFS4ERR_GRACE
:
case
-
NFS4ERR_GRACE
:
case
-
EKEYEXPIRED
:
case
-
EKEYEXPIRED
:
...
@@ -3513,12 +3514,6 @@ _nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
...
@@ -3513,12 +3514,6 @@ _nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
return
-
EAGAIN
;
return
-
EAGAIN
;
}
}
static
int
nfs4_async_handle_error
(
struct
rpc_task
*
task
,
const
struct
nfs_server
*
server
,
struct
nfs4_state
*
state
)
{
return
_nfs4_async_handle_error
(
task
,
server
,
server
->
nfs_client
,
state
);
}
int
nfs4_proc_setclientid
(
struct
nfs_client
*
clp
,
u32
program
,
int
nfs4_proc_setclientid
(
struct
nfs_client
*
clp
,
u32
program
,
unsigned
short
port
,
struct
rpc_cred
*
cred
,
unsigned
short
port
,
struct
rpc_cred
*
cred
,
struct
nfs4_setclientid_res
*
res
)
struct
nfs4_setclientid_res
*
res
)
...
@@ -5088,6 +5083,19 @@ static void nfs41_sequence_release(void *data)
...
@@ -5088,6 +5083,19 @@ static void nfs41_sequence_release(void *data)
kfree
(
calldata
);
kfree
(
calldata
);
}
}
static
int
nfs41_sequence_handle_errors
(
struct
rpc_task
*
task
,
struct
nfs_client
*
clp
)
{
switch
(
task
->
tk_status
)
{
case
-
NFS4ERR_DELAY
:
case
-
EKEYEXPIRED
:
rpc_delay
(
task
,
NFS4_POLL_RETRY_MAX
);
return
-
EAGAIN
;
default:
nfs4_schedule_state_recovery
(
clp
);
}
return
0
;
}
static
void
nfs41_sequence_call_done
(
struct
rpc_task
*
task
,
void
*
data
)
static
void
nfs41_sequence_call_done
(
struct
rpc_task
*
task
,
void
*
data
)
{
{
struct
nfs4_sequence_data
*
calldata
=
data
;
struct
nfs4_sequence_data
*
calldata
=
data
;
...
@@ -5100,9 +5108,8 @@ static void nfs41_sequence_call_done(struct rpc_task *task, void *data)
...
@@ -5100,9 +5108,8 @@ static void nfs41_sequence_call_done(struct rpc_task *task, void *data)
if
(
atomic_read
(
&
clp
->
cl_count
)
==
1
)
if
(
atomic_read
(
&
clp
->
cl_count
)
==
1
)
goto
out
;
goto
out
;
if
(
_nfs4_async_handle_error
(
task
,
NULL
,
clp
,
NULL
)
if
(
nfs41_sequence_handle_errors
(
task
,
clp
)
==
-
EAGAIN
)
{
==
-
EAGAIN
)
{
rpc_restart_call_prepare
(
task
);
nfs_restart_rpc
(
task
,
clp
);
return
;
return
;
}
}
}
}
...
@@ -5175,6 +5182,23 @@ static void nfs4_reclaim_complete_prepare(struct rpc_task *task, void *data)
...
@@ -5175,6 +5182,23 @@ static void nfs4_reclaim_complete_prepare(struct rpc_task *task, void *data)
rpc_call_start
(
task
);
rpc_call_start
(
task
);
}
}
static
int
nfs41_reclaim_complete_handle_errors
(
struct
rpc_task
*
task
,
struct
nfs_client
*
clp
)
{
switch
(
task
->
tk_status
)
{
case
0
:
case
-
NFS4ERR_COMPLETE_ALREADY
:
case
-
NFS4ERR_WRONG_CRED
:
/* What to do here? */
break
;
case
-
NFS4ERR_DELAY
:
case
-
EKEYEXPIRED
:
rpc_delay
(
task
,
NFS4_POLL_RETRY_MAX
);
return
-
EAGAIN
;
default:
nfs4_schedule_state_recovery
(
clp
);
}
return
0
;
}
static
void
nfs4_reclaim_complete_done
(
struct
rpc_task
*
task
,
void
*
data
)
static
void
nfs4_reclaim_complete_done
(
struct
rpc_task
*
task
,
void
*
data
)
{
{
struct
nfs4_reclaim_complete_data
*
calldata
=
data
;
struct
nfs4_reclaim_complete_data
*
calldata
=
data
;
...
@@ -5183,31 +5207,11 @@ static void nfs4_reclaim_complete_done(struct rpc_task *task, void *data)
...
@@ -5183,31 +5207,11 @@ static void nfs4_reclaim_complete_done(struct rpc_task *task, void *data)
dprintk
(
"--> %s
\n
"
,
__func__
);
dprintk
(
"--> %s
\n
"
,
__func__
);
nfs41_sequence_done
(
res
);
nfs41_sequence_done
(
res
);
switch
(
task
->
tk_status
)
{
case
0
:
if
(
nfs41_reclaim_complete_handle_errors
(
task
,
clp
)
==
-
EAGAIN
)
{
case
-
NFS4ERR_COMPLETE_ALREADY
:
break
;
case
-
NFS4ERR_BADSESSION
:
case
-
NFS4ERR_DEADSESSION
:
/*
* Handle the session error, but do not retry the operation, as
* we have no way of telling whether the clientid had to be
* reset before we got our reply. If reset, a new wave of
* reclaim operations will follow, containing their own reclaim
* complete. We don't want our retry to get on the way of
* recovery by incorrectly indicating to the server that we're
* done reclaiming state since the process had to be restarted.
*/
_nfs4_async_handle_error
(
task
,
NULL
,
clp
,
NULL
);
break
;
default:
if
(
_nfs4_async_handle_error
(
task
,
NULL
,
clp
,
NULL
)
==
-
EAGAIN
)
{
rpc_restart_call_prepare
(
task
);
rpc_restart_call_prepare
(
task
);
return
;
return
;
}
}
}
dprintk
(
"<-- %s
\n
"
,
__func__
);
dprintk
(
"<-- %s
\n
"
,
__func__
);
}
}
...
...
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