Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346256
b: refs/heads/master
c: 7970201
h: refs/heads/master
v: v3
  • Loading branch information
Philipp Reisner committed Nov 9, 2012
1 parent 113e3df commit d6e88af
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07fc96197aec46f7ad4f08a4b2a1ea426112e24d
refs/heads/master: 797020117761eee21ef284cea90c51c690fca169
29 changes: 23 additions & 6 deletions trunk/drivers/block/drbd/drbd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,24 @@ enum drbd_conns conn_lowest_conn(struct drbd_tconn *tconn)
return conn;
}

static bool no_peer_wf_report_params(struct drbd_tconn *tconn)
{
struct drbd_conf *mdev;
int vnr;
bool rv = true;

rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, vnr)
if (mdev->state.conn == C_WF_REPORT_PARAMS) {
rv = false;
break;
}
rcu_read_unlock();

return rv;
}


/**
* cl_wide_st_chg() - true if the state change is a cluster wide one
* @mdev: DRBD device.
Expand Down Expand Up @@ -971,6 +989,11 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns,
if (os.disk == D_ATTACHING && ns.disk >= D_NEGOTIATING)
drbd_print_uuids(mdev, "attached to UUIDs");

/* Wake up role changes, that were delayed because of connection establishing */
if (os.conn == C_WF_REPORT_PARAMS && ns.conn != C_WF_REPORT_PARAMS &&
no_peer_wf_report_params(mdev->tconn))
clear_bit(STATE_SENT, &mdev->tconn->flags);

wake_up(&mdev->misc_wait);
wake_up(&mdev->state_wait);
wake_up(&mdev->tconn->ping_wait);
Expand Down Expand Up @@ -1457,12 +1480,6 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
&& verify_can_do_stop_sector(mdev))
drbd_send_state(mdev, ns);

/* Wake up role changes, that were delayed because of connection establishing */
if (os.conn == C_WF_REPORT_PARAMS && ns.conn != C_WF_REPORT_PARAMS) {
if (test_and_clear_bit(STATE_SENT, &mdev->tconn->flags))
wake_up(&mdev->state_wait);
}

/* This triggers bitmap writeout of potentially still unwritten pages
* if the resync finished cleanly, or aborted because of peer disk
* failure, or because of connection loss.
Expand Down

0 comments on commit d6e88af

Please sign in to comment.