Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
fcff415c
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fcff415c
编写于
9月 14, 2016
作者:
Y
Yan, Zheng
提交者:
Ilya Dryomov
10月 03, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ceph: handle CEPH_SESSION_REJECT message
Signed-off-by:
N
Yan, Zheng
<
zyan@redhat.com
>
上级
ce2728aa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
5 deletion
+26
-5
fs/ceph/mds_client.c
fs/ceph/mds_client.c
+22
-5
fs/ceph/mds_client.h
fs/ceph/mds_client.h
+1
-0
fs/ceph/strings.c
fs/ceph/strings.c
+2
-0
include/linux/ceph/ceph_fs.h
include/linux/ceph/ceph_fs.h
+1
-0
未找到文件。
fs/ceph/mds_client.c
浏览文件 @
fcff415c
...
...
@@ -370,6 +370,7 @@ const char *ceph_session_state_name(int s)
case
CEPH_MDS_SESSION_CLOSING
:
return
"closing"
;
case
CEPH_MDS_SESSION_RESTARTING
:
return
"restarting"
;
case
CEPH_MDS_SESSION_RECONNECTING
:
return
"reconnecting"
;
case
CEPH_MDS_SESSION_REJECTED
:
return
"rejected"
;
default:
return
"???"
;
}
}
...
...
@@ -1378,7 +1379,7 @@ static int request_close_session(struct ceph_mds_client *mdsc,
if
(
!
msg
)
return
-
ENOMEM
;
ceph_con_send
(
&
session
->
s_con
,
msg
);
return
0
;
return
1
;
}
/*
...
...
@@ -2131,6 +2132,10 @@ static int __do_request(struct ceph_mds_client *mdsc,
ceph_session_state_name
(
session
->
s_state
));
if
(
session
->
s_state
!=
CEPH_MDS_SESSION_OPEN
&&
session
->
s_state
!=
CEPH_MDS_SESSION_HUNG
)
{
if
(
session
->
s_state
==
CEPH_MDS_SESSION_REJECTED
)
{
err
=
-
EACCES
;
goto
out_session
;
}
if
(
session
->
s_state
==
CEPH_MDS_SESSION_NEW
||
session
->
s_state
==
CEPH_MDS_SESSION_CLOSING
)
__open_session
(
mdsc
,
session
);
...
...
@@ -2652,6 +2657,15 @@ static void handle_session(struct ceph_mds_session *session,
wake_up_session_caps
(
session
,
0
);
break
;
case
CEPH_SESSION_REJECT
:
WARN_ON
(
session
->
s_state
!=
CEPH_MDS_SESSION_OPENING
);
pr_info
(
"mds%d rejected session
\n
"
,
session
->
s_mds
);
session
->
s_state
=
CEPH_MDS_SESSION_REJECTED
;
cleanup_session_requests
(
mdsc
,
session
);
remove_session_caps
(
session
);
wake
=
2
;
/* for good measure */
break
;
default:
pr_err
(
"mdsc_handle_session bad op %d mds%d
\n
"
,
op
,
mds
);
WARN_ON
(
1
);
...
...
@@ -3557,11 +3571,11 @@ void ceph_mdsc_sync(struct ceph_mds_client *mdsc)
/*
* true if all sessions are closed, or we force unmount
*/
static
bool
done_closing_sessions
(
struct
ceph_mds_client
*
mdsc
)
static
bool
done_closing_sessions
(
struct
ceph_mds_client
*
mdsc
,
int
skipped
)
{
if
(
ACCESS_ONCE
(
mdsc
->
fsc
->
mount_state
)
==
CEPH_MOUNT_SHUTDOWN
)
return
true
;
return
atomic_read
(
&
mdsc
->
num_sessions
)
==
0
;
return
atomic_read
(
&
mdsc
->
num_sessions
)
<=
skipped
;
}
/*
...
...
@@ -3572,6 +3586,7 @@ void ceph_mdsc_close_sessions(struct ceph_mds_client *mdsc)
struct
ceph_options
*
opts
=
mdsc
->
fsc
->
client
->
options
;
struct
ceph_mds_session
*
session
;
int
i
;
int
skipped
=
0
;
dout
(
"close_sessions
\n
"
);
...
...
@@ -3583,7 +3598,8 @@ void ceph_mdsc_close_sessions(struct ceph_mds_client *mdsc)
continue
;
mutex_unlock
(
&
mdsc
->
mutex
);
mutex_lock
(
&
session
->
s_mutex
);
__close_session
(
mdsc
,
session
);
if
(
__close_session
(
mdsc
,
session
)
<=
0
)
skipped
++
;
mutex_unlock
(
&
session
->
s_mutex
);
ceph_put_mds_session
(
session
);
mutex_lock
(
&
mdsc
->
mutex
);
...
...
@@ -3591,7 +3607,8 @@ void ceph_mdsc_close_sessions(struct ceph_mds_client *mdsc)
mutex_unlock
(
&
mdsc
->
mutex
);
dout
(
"waiting for sessions to close
\n
"
);
wait_event_timeout
(
mdsc
->
session_close_wq
,
done_closing_sessions
(
mdsc
),
wait_event_timeout
(
mdsc
->
session_close_wq
,
done_closing_sessions
(
mdsc
,
skipped
),
ceph_timeout_jiffies
(
opts
->
mount_timeout
));
/* tear down remaining sessions */
...
...
fs/ceph/mds_client.h
浏览文件 @
fcff415c
...
...
@@ -121,6 +121,7 @@ enum {
CEPH_MDS_SESSION_CLOSING
=
5
,
CEPH_MDS_SESSION_RESTARTING
=
6
,
CEPH_MDS_SESSION_RECONNECTING
=
7
,
CEPH_MDS_SESSION_REJECTED
=
8
,
};
struct
ceph_mds_session
{
...
...
fs/ceph/strings.c
浏览文件 @
fcff415c
...
...
@@ -43,6 +43,8 @@ const char *ceph_session_op_name(int op)
case
CEPH_SESSION_RECALL_STATE
:
return
"recall_state"
;
case
CEPH_SESSION_FLUSHMSG
:
return
"flushmsg"
;
case
CEPH_SESSION_FLUSHMSG_ACK
:
return
"flushmsg_ack"
;
case
CEPH_SESSION_FORCE_RO
:
return
"force_ro"
;
case
CEPH_SESSION_REJECT
:
return
"reject"
;
}
return
"???"
;
}
...
...
include/linux/ceph/ceph_fs.h
浏览文件 @
fcff415c
...
...
@@ -281,6 +281,7 @@ enum {
CEPH_SESSION_FLUSHMSG
,
CEPH_SESSION_FLUSHMSG_ACK
,
CEPH_SESSION_FORCE_RO
,
CEPH_SESSION_REJECT
,
};
extern
const
char
*
ceph_session_op_name
(
int
op
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录