diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-01-05 11:04:04 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-02-19 13:31:37 +0300 |
commit | 03f4fcb02884859b584c709652bb48f8125ceb45 (patch) | |
tree | a65b5f4bb6661d17b9a9bdacf7b1c27ddff33137 /fs/ceph/mds_client.c | |
parent | f646912d1044ace6c6c5b5785b2579177781873b (diff) | |
download | lwn-03f4fcb02884859b584c709652bb48f8125ceb45.tar.gz lwn-03f4fcb02884859b584c709652bb48f8125ceb45.zip |
ceph: handle SESSION_FORCE_RO message
mark session as readonly and wake up all cap waiters.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r-- | fs/ceph/mds_client.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index d2171f4a6980..c6c33b411a2f 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -2580,6 +2580,14 @@ static void handle_session(struct ceph_mds_session *session, send_flushmsg_ack(mdsc, session, seq); break; + case CEPH_SESSION_FORCE_RO: + dout("force_session_readonly %p\n", session); + spin_lock(&session->s_cap_lock); + session->s_readonly = true; + spin_unlock(&session->s_cap_lock); + wake_up_session_caps(session, 0); + break; + default: pr_err("mdsc_handle_session bad op %d mds%d\n", op, mds); WARN_ON(1); @@ -2791,6 +2799,8 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, spin_unlock(&session->s_gen_ttl_lock); spin_lock(&session->s_cap_lock); + /* don't know if session is readonly */ + session->s_readonly = 0; /* * notify __ceph_remove_cap() that we are composing cap reconnect. * If a cap get released before being added to the cap reconnect, |