Commit fc3b10a4 authored by Philipp Reisner's avatar Philipp Reisner

drbd: Implemented receiving of P_CONN_ST_CHG_REPLY

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 5aabf467
...@@ -914,6 +914,8 @@ enum { ...@@ -914,6 +914,8 @@ enum {
SEND_PING, /* whether asender should send a ping asap */ SEND_PING, /* whether asender should send a ping asap */
SIGNAL_ASENDER, /* whether asender wants to be interrupted */ SIGNAL_ASENDER, /* whether asender wants to be interrupted */
GOT_PING_ACK, /* set when we receive a ping_ack packet, ping_wait gets woken */ GOT_PING_ACK, /* set when we receive a ping_ack packet, ping_wait gets woken */
CONN_WD_ST_CHG_OKAY,
CONN_WD_ST_CHG_FAIL,
}; };
struct drbd_tconn { /* is a resource from the config file */ struct drbd_tconn { /* is a resource from the config file */
......
...@@ -4265,9 +4265,11 @@ int drbdd_init(struct drbd_thread *thi) ...@@ -4265,9 +4265,11 @@ int drbdd_init(struct drbd_thread *thi)
static int got_RqSReply(struct drbd_conf *mdev, enum drbd_packet cmd) static int got_RqSReply(struct drbd_conf *mdev, enum drbd_packet cmd)
{ {
struct p_req_state_reply *p = &mdev->tconn->meta.rbuf.req_state_reply; struct p_req_state_reply *p = &mdev->tconn->meta.rbuf.req_state_reply;
struct drbd_tconn *tconn = mdev->tconn;
int retcode = be32_to_cpu(p->retcode); int retcode = be32_to_cpu(p->retcode);
if (cmd == P_STATE_CHG_REPLY) {
if (retcode >= SS_SUCCESS) { if (retcode >= SS_SUCCESS) {
set_bit(CL_ST_CHG_SUCCESS, &mdev->flags); set_bit(CL_ST_CHG_SUCCESS, &mdev->flags);
} else { } else {
...@@ -4276,7 +4278,16 @@ static int got_RqSReply(struct drbd_conf *mdev, enum drbd_packet cmd) ...@@ -4276,7 +4278,16 @@ static int got_RqSReply(struct drbd_conf *mdev, enum drbd_packet cmd)
drbd_set_st_err_str(retcode), retcode); drbd_set_st_err_str(retcode), retcode);
} }
wake_up(&mdev->state_wait); wake_up(&mdev->state_wait);
} else /* conn == P_CONN_ST_CHG_REPLY */ {
if (retcode >= SS_SUCCESS) {
set_bit(CONN_WD_ST_CHG_OKAY, &tconn->flags);
} else {
set_bit(CONN_WD_ST_CHG_FAIL, &tconn->flags);
conn_err(tconn, "Requested state change failed by peer: %s (%d)\n",
drbd_set_st_err_str(retcode), retcode);
}
wake_up(&tconn->ping_wait);
}
return true; return true;
} }
...@@ -4553,6 +4564,7 @@ static struct asender_cmd *get_asender_cmd(int cmd) ...@@ -4553,6 +4564,7 @@ static struct asender_cmd *get_asender_cmd(int cmd)
[P_RS_IS_IN_SYNC] = { sizeof(struct p_block_ack), got_IsInSync }, [P_RS_IS_IN_SYNC] = { sizeof(struct p_block_ack), got_IsInSync },
[P_DELAY_PROBE] = { sizeof(struct p_delay_probe93), got_skip }, [P_DELAY_PROBE] = { sizeof(struct p_delay_probe93), got_skip },
[P_RS_CANCEL] = { sizeof(struct p_block_ack), got_NegRSDReply}, [P_RS_CANCEL] = { sizeof(struct p_block_ack), got_NegRSDReply},
[P_CONN_ST_CHG_REPLY]={ sizeof(struct p_req_state_reply), got_RqSReply },
[P_MAX_CMD] = { 0, NULL }, [P_MAX_CMD] = { 0, NULL },
}; };
if (cmd > P_MAX_CMD || asender_tbl[cmd].process == NULL) if (cmd > P_MAX_CMD || asender_tbl[cmd].process == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment