summaryrefslogtreecommitdiff
path: root/fs/ceph
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2017-03-28 12:56:29 +0300
committerIlya Dryomov <idryomov@gmail.com>2017-05-04 10:19:20 +0300
commit2827528da003ad207930f0d1af5faf3e482d6393 (patch)
treefdbbd24c42f33e8d221dd7e3844a26444a89c8ec /fs/ceph
parent0a07fc8cd01b6838d999a5eacaa99fe90b8f768b (diff)
downloadlinux-2827528da003ad207930f0d1af5faf3e482d6393.tar.xz
ceph: close stopped mds' session
If a mds has stopped, close its session and clean up its session requests/caps. The process is similar to handling SESSION_CLOSE initiated by mds. Signed-off-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/mds_client.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 3bdff7ae7bfd..a22688873ec3 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -3136,6 +3136,22 @@ static void check_new_map(struct ceph_mds_client *mdsc,
__unregister_session(mdsc, s);
__wake_requests(mdsc, &s->s_waiting);
ceph_put_mds_session(s);
+ } else if (i >= newmap->m_num_mds) {
+ /* force close session for stopped mds */
+ get_session(s);
+ __unregister_session(mdsc, s);
+ __wake_requests(mdsc, &s->s_waiting);
+ kick_requests(mdsc, i);
+ mutex_unlock(&mdsc->mutex);
+
+ mutex_lock(&s->s_mutex);
+ cleanup_session_requests(mdsc, s);
+ remove_session_caps(s);
+ mutex_unlock(&s->s_mutex);
+
+ ceph_put_mds_session(s);
+
+ mutex_lock(&mdsc->mutex);
} else {
/* just close it */
mutex_unlock(&mdsc->mutex);