Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1923545
b: refs/heads/develop-4.19
c: 0f9af16
h: refs/heads/develop-4.4
i:
  1923543: fbedbdc
  • Loading branch information
idryomov committed Mar 25, 2016
1 parent baeaa64 commit 2a19f09
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ refs/heads/stable-4.4-rk3288-linux-v2.x: 0cac436bf5c08a436009dd944fad317b159d904
"refs/heads/stable-4.4-rk3399pro_npu-linux": b592dda51a9b4f8531d5bfe79dbed2e117e801fc
"refs/heads/stable-4.4-rk3399pro_npu_pvtm32k-linux": 028d7605cf6ba614f547be57f080423bbbb7df3b
"refs/heads/stable-4.4-rk3399pro_npu-pcie-linux": bc673f1b71315f2d76827693f74a429894557cb7
refs/heads/develop-4.19: 02ac956c42c6284220f427568d5de3ea64aca41c
refs/heads/develop-4.19: 0f9af169a1db62c33d87e4cfda46493907bd5537
31 changes: 22 additions & 9 deletions branches/develop-4.19/net/ceph/mon_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,6 @@ static void handle_subscribe_ack(struct ceph_mon_client *monc,
seconds = le32_to_cpu(h->duration);

mutex_lock(&monc->mutex);
if (monc->hunting) {
pr_info("mon%d %s session established\n",
monc->cur_mon,
ceph_pr_addr(&monc->con.peer_addr.in_addr));
monc->hunting = false;
}
dout("handle_subscribe_ack after %d seconds\n", seconds);
monc->sub_renew_after = monc->sub_sent + (seconds >> 1)*HZ - 1;
monc->sub_sent = 0;
Expand Down Expand Up @@ -877,6 +871,14 @@ void ceph_monc_stop(struct ceph_mon_client *monc)
}
EXPORT_SYMBOL(ceph_monc_stop);

static void finish_hunting(struct ceph_mon_client *monc)
{
if (monc->hunting) {
dout("%s found mon%d\n", __func__, monc->cur_mon);
monc->hunting = false;
}
}

static void handle_auth_reply(struct ceph_mon_client *monc,
struct ceph_msg *msg)
{
Expand All @@ -890,11 +892,15 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
msg->front.iov_len,
monc->m_auth->front.iov_base,
monc->m_auth->front_alloc_len);
if (ret > 0) {
__send_prepared_auth_request(monc, ret);
goto out;
}

finish_hunting(monc);

if (ret < 0) {
monc->client->auth_err = ret;
wake_up_all(&monc->client->auth_wq);
} else if (ret > 0) {
__send_prepared_auth_request(monc, ret);
} else if (!was_auth && ceph_auth_is_authenticated(monc->auth)) {
dout("authenticated, starting session\n");

Expand All @@ -904,8 +910,15 @@ static void handle_auth_reply(struct ceph_mon_client *monc,

__send_subscribe(monc);
__resend_generic_request(monc);

pr_info("mon%d %s session established\n", monc->cur_mon,
ceph_pr_addr(&monc->con.peer_addr.in_addr));
}

out:
mutex_unlock(&monc->mutex);
if (monc->client->auth_err < 0)
wake_up_all(&monc->client->auth_wq);
}

static int __validate_auth(struct ceph_mon_client *monc)
Expand Down

0 comments on commit 2a19f09

Please sign in to comment.