diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index b8d6cca16005..52f5e40a341d 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1754,7 +1754,7 @@ static void cleanup_session_requests(struct ceph_mds_client *mdsc, struct ceph_mds_request *req; struct rb_node *p; - dout("cleanup_session_requests mds%d\n", session->s_mds); + pr_info("cleanup_session_requests mds%d\n", session->s_mds); mutex_lock(&mdsc->mutex); while (!list_empty(&session->s_unsafe)) { req = list_first_entry(&session->s_unsafe, @@ -1773,8 +1773,12 @@ static void cleanup_session_requests(struct ceph_mds_client *mdsc, req = rb_entry(p, struct ceph_mds_request, r_node); p = rb_next(p); if (req->r_session && - req->r_session->s_mds == session->s_mds) + req->r_session->s_mds == session->s_mds) { + if (req->r_attempts) + pr_info("mds%d req tid %llu reattempted\n", + session->s_mds, req->r_tid); req->r_attempts = 0; + } } mutex_unlock(&mdsc->mutex); } @@ -3235,7 +3239,8 @@ static void __do_request(struct ceph_mds_client *mdsc, goto finish; } if (mdsc->mdsmap->m_epoch == 0) { - dout("do_request no mdsmap, waiting for map\n"); + pr_info("do_request no mdsmap, waiting for map req tid %llu\n", + req->r_tid); list_add(&req->r_wait, &mdsc->waiting_for_map); return; } @@ -3256,7 +3261,8 @@ static void __do_request(struct ceph_mds_client *mdsc, err = -EJUKEBOX; goto finish; } - dout("do_request no mds or not active, waiting for map\n"); + pr_info("do_request no mds or not active, waiting for map req tid %llu\n", + req->r_tid); list_add(&req->r_wait, &mdsc->waiting_for_map); return; } @@ -3302,8 +3308,10 @@ static void __do_request(struct ceph_mds_client *mdsc, * it to the mdsc queue. */ if (session->s_state == CEPH_MDS_SESSION_REJECTED) { - if (ceph_test_mount_opt(mdsc->fsc, CLEANRECOVER)) + if (ceph_test_mount_opt(mdsc->fsc, CLEANRECOVER)) { + pr_info(" CLEANRECOVER req tid %llu\n", req->r_tid); list_add(&req->r_wait, &mdsc->waiting_for_map); + } else err = -EACCES; goto out_session; @@ -3318,6 +3326,7 @@ static void __do_request(struct ceph_mds_client *mdsc, if (random) req->r_resend_mds = mds; } + pr_info(" session is not opened, req tid %llu\n", req->r_tid); list_add(&req->r_wait, &session->s_waiting); goto out_session; } @@ -3621,6 +3630,14 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) } dout("handle_reply %p\n", req); + /* waiting, not yet submitted? */ + if (!list_empty(&req->r_wait)) { + pr_err("mdsc_handle_reply on waiting request tid %llu\n", tid); + mutex_unlock(&mdsc->mutex); + ceph_msg_dump(msg); + goto out; + } + /* correct session? */ if (req->r_session != session) { pr_err("mdsc_handle_reply got %llu on session mds%d" @@ -4019,6 +4036,7 @@ static void handle_session(struct ceph_mds_session *session, case CEPH_SESSION_CLOSE: if (session->s_state == CEPH_MDS_SESSION_RECONNECTING) pr_info("mds%d reconnect denied\n", session->s_mds); + pr_info("mds%d closed our session\n", session->s_mds); session->s_state = CEPH_MDS_SESSION_CLOSED; cleanup_session_requests(mdsc, session); remove_session_caps(session); @@ -4727,6 +4745,7 @@ static void check_new_map(struct ceph_mds_client *mdsc, __wake_requests(mdsc, &s->s_waiting); mutex_unlock(&mdsc->mutex); + pr_info("check_new_map exceed max rank mds%d\n", i); mutex_lock(&s->s_mutex); cleanup_session_requests(mdsc, s); remove_session_caps(s); @@ -5483,6 +5502,7 @@ void ceph_mdsc_force_umount(struct ceph_mds_client *mdsc) mutex_lock(&session->s_mutex); __close_session(mdsc, session); if (session->s_state == CEPH_MDS_SESSION_CLOSING) { + pr_info("ceph_mdsc_force_umount mds%d\n", mds); cleanup_session_requests(mdsc, session); remove_session_caps(session); }