Commit 2325eb66 authored by Philipp Reisner's avatar Philipp Reisner

drbd: New minors have to intherit the connection state form their connection

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 082a3439
...@@ -1595,6 +1595,7 @@ extern void _drbd_wait_ee_list_empty(struct drbd_conf *mdev, ...@@ -1595,6 +1595,7 @@ extern void _drbd_wait_ee_list_empty(struct drbd_conf *mdev,
extern void drbd_set_recv_tcq(struct drbd_conf *mdev, int tcq_enabled); extern void drbd_set_recv_tcq(struct drbd_conf *mdev, int tcq_enabled);
extern void _drbd_clear_done_ee(struct drbd_conf *mdev, struct list_head *to_be_freed); extern void _drbd_clear_done_ee(struct drbd_conf *mdev, struct list_head *to_be_freed);
extern void conn_flush_workqueue(struct drbd_tconn *tconn); extern void conn_flush_workqueue(struct drbd_tconn *tconn);
extern int drbd_connected(int vnr, void *p, void *data);
static inline void drbd_flush_workqueue(struct drbd_conf *mdev) static inline void drbd_flush_workqueue(struct drbd_conf *mdev)
{ {
conn_flush_workqueue(mdev->tconn); conn_flush_workqueue(mdev->tconn);
......
...@@ -2410,6 +2410,11 @@ enum drbd_ret_code conn_new_minor(struct drbd_tconn *tconn, unsigned int minor, ...@@ -2410,6 +2410,11 @@ enum drbd_ret_code conn_new_minor(struct drbd_tconn *tconn, unsigned int minor,
} }
add_disk(disk); add_disk(disk);
/* inherit the connection state */
mdev->state.conn = tconn->cstate;
if (mdev->state.conn == C_WF_REPORT_PARAMS)
drbd_connected(vnr, mdev, tconn);
return NO_ERROR; return NO_ERROR;
out_idr_remove_vol: out_idr_remove_vol:
......
...@@ -744,8 +744,9 @@ static int drbd_socket_okay(struct socket **sock) ...@@ -744,8 +744,9 @@ static int drbd_socket_okay(struct socket **sock)
return false; return false;
} }
} }
/* Gets called if a connection is established, or if a new minor gets created
static int drbd_connected(int vnr, void *p, void *data) in a connection */
int drbd_connected(int vnr, void *p, void *data)
{ {
struct drbd_conf *mdev = (struct drbd_conf *)p; struct drbd_conf *mdev = (struct drbd_conf *)p;
int ok = 1; int ok = 1;
......
...@@ -432,8 +432,8 @@ is_valid_soft_transition(union drbd_state os, union drbd_state ns) ...@@ -432,8 +432,8 @@ is_valid_soft_transition(union drbd_state os, union drbd_state ns)
if (ns.conn == C_DISCONNECTING && os.conn == C_UNCONNECTED) if (ns.conn == C_DISCONNECTING && os.conn == C_UNCONNECTED)
rv = SS_IN_TRANSIENT_STATE; rv = SS_IN_TRANSIENT_STATE;
if (ns.conn == os.conn && ns.conn == C_WF_REPORT_PARAMS) /* if (ns.conn == os.conn && ns.conn == C_WF_REPORT_PARAMS)
rv = SS_IN_TRANSIENT_STATE; rv = SS_IN_TRANSIENT_STATE; */
if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) && os.conn < C_CONNECTED) if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) && os.conn < C_CONNECTED)
rv = SS_NEED_CONNECTION; rv = SS_NEED_CONNECTION;
......
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