Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
aa5190d0
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aa5190d0
编写于
6月 16, 2010
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFSv4: Kill nfs4_async_handle_error() abuses by NFSv4.1
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
d185a334
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
37 deletion
+41
-37
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+41
-37
未找到文件。
fs/nfs/nfs4proc.c
浏览文件 @
aa5190d0
...
...
@@ -3457,9 +3457,11 @@ static int nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t buflen
}
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
;
switch
(
task
->
tk_status
)
{
case
-
NFS4ERR_ADMIN_REVOKED
:
...
...
@@ -3491,8 +3493,7 @@ _nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
return
-
EAGAIN
;
#endif
/* CONFIG_NFS_V4_1 */
case
-
NFS4ERR_DELAY
:
if
(
server
)
nfs_inc_server_stats
(
server
,
NFSIOS_DELAY
);
nfs_inc_server_stats
(
server
,
NFSIOS_DELAY
);
case
-
NFS4ERR_GRACE
:
case
-
EKEYEXPIRED
:
rpc_delay
(
task
,
NFS4_POLL_RETRY_MAX
);
...
...
@@ -3513,12 +3514,6 @@ _nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server,
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
,
unsigned
short
port
,
struct
rpc_cred
*
cred
,
struct
nfs4_setclientid_res
*
res
)
...
...
@@ -5088,6 +5083,19 @@ static void nfs41_sequence_release(void *data)
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
)
{
struct
nfs4_sequence_data
*
calldata
=
data
;
...
...
@@ -5100,9 +5108,8 @@ static void nfs41_sequence_call_done(struct rpc_task *task, void *data)
if
(
atomic_read
(
&
clp
->
cl_count
)
==
1
)
goto
out
;
if
(
_nfs4_async_handle_error
(
task
,
NULL
,
clp
,
NULL
)
==
-
EAGAIN
)
{
nfs_restart_rpc
(
task
,
clp
);
if
(
nfs41_sequence_handle_errors
(
task
,
clp
)
==
-
EAGAIN
)
{
rpc_restart_call_prepare
(
task
);
return
;
}
}
...
...
@@ -5175,6 +5182,23 @@ static void nfs4_reclaim_complete_prepare(struct rpc_task *task, void *data)
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
)
{
struct
nfs4_reclaim_complete_data
*
calldata
=
data
;
...
...
@@ -5183,31 +5207,11 @@ static void nfs4_reclaim_complete_done(struct rpc_task *task, void *data)
dprintk
(
"--> %s
\n
"
,
__func__
);
nfs41_sequence_done
(
res
);
switch
(
task
->
tk_status
)
{
case
0
:
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
);
return
;
}
}
if
(
nfs41_reclaim_complete_handle_errors
(
task
,
clp
)
==
-
EAGAIN
)
{
rpc_restart_call_prepare
(
task
);
return
;
}
dprintk
(
"<-- %s
\n
"
,
__func__
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录