Lines Matching refs:mds
69 * mds reply parsing
326 pr_err("problem parsing mds trace %d\n", err);
574 * parse entire mds reply
619 pr_err("mds parse_reply err %d\n", err);
682 int mds)
684 if (mds >= mdsc->max_sessions || !mdsc->sessions[mds])
686 return ceph_get_mds_session(mdsc->sessions[mds]);
689 static bool __have_session(struct ceph_mds_client *mdsc, int mds)
691 if (mds >= mdsc->max_sessions || !mdsc->sessions[mds])
707 * create+register a new session for given mds.
711 int mds)
715 if (mds >= mdsc->mdsmap->possible_max_rank)
722 if (mds >= mdsc->max_sessions) {
723 int newmax = 1 << get_count_order(mds + 1);
739 dout("%s: mds%d\n", __func__, mds);
741 s->s_mds = mds;
771 mdsc->sessions[mds] = s;
775 ceph_con_open(&s->s_con, CEPH_ENTITY_TYPE_MDS, mds,
776 ceph_mdsmap_get_addr(mdsc->mdsmap, mds));
791 dout("__unregister_session mds%d %p\n", s->s_mds, s);
816 int mds;
819 for (mds = 0; mds < mdsc->max_sessions; ++mds) {
822 s = __ceph_lookup_mds_session(mdsc, mds);
852 /* avoid calling iput_final() in mds dispatch threads */
988 /* avoid calling iput_final() in mds dispatch threads */
1021 * Choose mds to send request to next. If there is a hint set in the
1022 * request (e.g., due to a prior forward hint from the mds), use that.
1024 * appropriate mds. If all else fails, choose randomly.
1036 int mds = -1;
1044 * is there a specific mds we should try? ignore hint if we have
1045 * no session and the mds is not up (active or recovering).
1050 dout("%s using resend_mds mds%d\n", __func__,
1122 mds = frag.dist[r];
1123 dout("%s %p %llx.%llx frag %u mds%d (%d/%d)\n",
1125 frag.frag, mds, (int)r, frag.ndist);
1126 if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
1128 !ceph_mdsmap_is_laggy(mdsc->mdsmap, mds))
1134 * authoritative mds. */
1135 if (frag.mds >= 0) {
1136 /* choose auth mds */
1137 mds = frag.mds;
1138 dout("%s %p %llx.%llx frag %u mds%d (auth)\n",
1140 frag.frag, mds);
1141 if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
1144 mds))
1163 mds = cap->session->s_mds;
1164 dout("%s %p %llx.%llx mds%d (%scap %p)\n", __func__,
1165 inode, ceph_vinop(inode), mds,
1170 * in mds dispatch threads */
1172 return mds;
1178 mds = ceph_mdsmap_get_random_mds(mdsc->mdsmap);
1179 dout("%s chose random mds%d\n", __func__, mds);
1180 return mds;
1398 int mds = session->s_mds;
1400 /* wait for mds to go active? */
1401 mstate = ceph_mdsmap_get_state(mdsc->mdsmap, mds);
1402 dout("open_session to mds%d (%s)\n", mds,
1416 * open sessions for any export targets for the given mds
1447 dout("open_export_target_session to mds%d\n", target);
1461 int i, mds = session->s_mds;
1463 if (mds >= mdsc->mdsmap->possible_max_rank)
1466 mi = &mdsc->mdsmap->m_info[mds];
1467 dout("open_export_target_sessions for mds%d (%d targets)\n",
1495 dout("dispose_cap_releases mds%d\n", session->s_mds);
1516 dout("cleanup_session_requests mds%d\n", session->s_mds);
1557 dout("iterate_session_caps %p mds%d\n", session, session->s_mds);
1572 * s_mutex or in mds dispatch threads */
1818 /* mds did not re-issue stale cap */
1831 dout("wake_up_session_caps %p mds%d\n", session, session->s_mds);
1850 pr_info("mds%d caps stale\n", session->s_mds);
1853 /* do not try to renew caps until a recovering mds has reconnected
1857 dout("send_renew_caps ignoring mds%d (%s)\n",
1862 dout("send_renew_caps to mds%d (%s)\n", session->s_mds,
1877 dout("send_flushmsg_ack to mds%d (%s)s seq %lld\n",
1906 pr_info("mds%d caps renewed\n", session->s_mds);
1909 pr_info("mds%d caps still stale\n", session->s_mds);
1912 dout("renewed_caps mds%d ttl now %lu, was %s, now %s\n",
1928 dout("request_close_session mds%d state %s seq %lld\n",
2010 * of lock mds request will re-add auth caps. */
2063 dout("trim_caps mds%d start: %d / %d, trim %d\n",
2069 dout("trim_caps mds%d done: %d / %d, trimmed %d\n",
2178 dout("send_cap_releases mds%d %p\n", session->s_mds, msg);
2198 dout("send_cap_releases mds%d %p\n", session->s_mds, msg);
2203 pr_err("send_cap_releases mds%d, failed to allocate message\n",
2329 * Create an mds request.
2551 int mds, bool drop_cap_releases)
2629 mds, req->r_inode_drop, req->r_inode_unless,
2633 req->r_parent, mds, req->r_dentry_drop,
2637 req->r_old_dentry_dir, mds,
2643 mds, req->r_old_inode_drop, req->r_old_inode_unless, 0);
2707 int mds, bool drop_cap_releases)
2716 ceph_get_cap_for_mds(ceph_inode(req->r_inode), mds);
2766 msg = create_request_message(mdsc, req, mds, drop_cap_releases);
2816 int mds = -1;
2858 mds = __choose_mds(mdsc, req, &random);
2859 if (mds < 0 ||
2860 ceph_mdsmap_get_state(mdsc->mdsmap, mds) < CEPH_MDS_STATE_ACTIVE) {
2865 dout("do_request no mds or not active, waiting for map\n");
2871 session = __ceph_lookup_mds_session(mdsc, mds);
2873 session = register_session(mdsc, mds);
2881 dout("do_request mds%d session %p state %s\n", mds, session,
2903 /* retry the same mds later */
2905 req->r_resend_mds = mds;
2912 req->r_resend_mds = -1; /* forget any previous mds hint */
2952 * Wake up threads with requests pending for @mds, so that they can
2953 * resubmit their requests to a possibly different mds.
2955 static void kick_requests(struct ceph_mds_client *mdsc, int mds)
2960 dout("kick_requests mds%d\n", mds);
2969 req->r_session->s_mds == mds) {
3077 * Synchrously perform an mds request. Take care of all of the
3117 * Handle mds reply.
3132 int mds = session->s_mds;
3153 pr_err("mdsc_handle_reply got %llu on session mds%d"
3154 " not mds%d\n", tid, session->s_mds,
3163 pr_warn("got a dup %s reply on %llu from mds%d\n",
3164 head->safe ? "safe" : "unsafe", tid, mds);
3169 pr_warn("got unsafe after safe on %llu from mds%d\n",
3170 tid, mds);
3194 int mds = __choose_mds(mdsc, req, NULL);
3195 if (mds >= 0 && mds != req->r_session->s_mds) {
3222 dout("got safe reply %llu, mds%d\n", tid, mds);
3242 pr_err("mdsc_handle_reply got corrupt reply mds%d(tid:%lld)\n", mds, tid);
3318 * handle mds notification that our request has been forwarded.
3339 dout("forward tid %llu to mds%d - req dne\n", tid, next_mds);
3347 dout("forward tid %llu to mds%d - old seq %d <= %d\n",
3350 /* resend. forward race not possible; mds would drop */
3351 dout("forward tid %llu to mds%d (we resend)\n", tid, next_mds);
3398 * handle a mds session control message
3404 int mds = session->s_mds;
3446 dout("handle_session mds%d %s %p state %s seq %llu\n",
3447 mds, ceph_session_op_name(op), session,
3452 pr_info("mds%d came back\n", session->s_mds);
3458 pr_info("mds%d reconnect success\n", session->s_mds);
3476 pr_info("mds%d reconnect denied\n", session->s_mds);
3485 pr_info("mds%d caps went stale, renewing\n",
3518 pr_info("mds%d rejected session\n", session->s_mds);
3528 pr_err("mdsc_handle_session bad op %d mds%d\n", op, mds);
3537 kick_requests(mdsc, mds);
3545 pr_err("mdsc_handle_session corrupt message mds%d len %d\n", mds,
3583 dout("replay_unsafe_requests mds%d\n", session->s_mds);
3918 * snaprealms. we provide mds with the ino, seq (version), and
3919 * parent for all of our realms. If the mds has any newer info,
3968 * clear which snap realms the mds cares about, we send everything we
3978 int mds = session->s_mds;
3985 pr_info("mds%d reconnect start\n", mds);
4028 CEPH_ENTITY_TYPE_MDS, mds,
4029 ceph_mdsmap_get_addr(mdsc->mdsmap, mds));
4138 pr_err("error %d preparing reconnect for mds%d\n", err, mds);
4167 dout("check_new_map mds%d state %s%s -> %s%s (session %s)\n",
4175 /* force close session for stopped mds */
4204 continue; /* nothing new with this mds */
4218 * kick request on any mds that has gone active.
4224 pr_info("mds%d recovery completed\n", s->s_mds);
4244 dout(" connecting to export targets of laggy mds%d\n",
4276 int mds = session->s_mds;
4283 dout("handle_lease from mds%d\n", mds);
4365 /* avoid calling iput_final() in mds dispatch threads */
4383 dout("lease_send_msg identry %p %s to mds%d\n",
4449 pr_info("mds%d hung\n", s->s_mds);
4479 dout("resending session close request for mds%d\n", s->s_mds);
4482 pr_err("unable to close session to mds%d: %d\n",
4488 * delayed work -- periodically trim expired leases, renew caps with mds. If
4644 * Wait for safe replies on open mds requests. If we time out, drop
4684 dout("request mdlog flush to mds%d (%s)s seq %lld\n", s->s_mds,
4689 pr_err("failed to request mdlog flush to mds%d (%s) seq %lld\n",
4721 * wait for all write mds requests to flush.
4868 int mds;
4873 for (mds = 0; mds < mdsc->max_sessions; mds++) {
4874 session = __ceph_lookup_mds_session(mdsc, mds);
4893 kick_requests(mdsc, mds);
5016 * handle mds map update.
5058 mdsc->mdsmap = newmap; /* first mds map */
5095 * if the client is unresponsive for long enough, the mds will kill
5103 pr_warn("mds%d closed our session\n", s->s_mds);