Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346151
b: refs/heads/master
c: b8853db
h: refs/heads/master
i:
  346149: f12fe3b
  346147: 1f46c32
  346143: 558dcac
v: v3
  • Loading branch information
Philipp Reisner committed Nov 8, 2012
1 parent 27891e3 commit fea2c8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57bcb6cf1ddb1593face20a13b140be19af9f6cd
refs/heads/master: b8853dbd8c6410d1faef2785e8ee4c990b068a77
13 changes: 13 additions & 0 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3787,6 +3787,12 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi)
os = ns = drbd_read_state(mdev);
spin_unlock_irq(&mdev->tconn->req_lock);

/* If some other part of the code (asender thread, timeout)
* already decided to close the connection again,
* we must not "re-establish" it here. */
if (os.conn <= C_TEAR_DOWN)
return false;

/* If this is the "end of sync" confirmation, usually the peer disk
* transitions from D_INCONSISTENT to D_UP_TO_DATE. For empty (0 bits
* set) resync started in PausedSyncT, or if the timing of pause-/
Expand Down Expand Up @@ -4368,6 +4374,13 @@ static void conn_disconnect(struct drbd_tconn *tconn)
if (tconn->cstate == C_STANDALONE)
return;

/* We are about to start the cleanup after connection loss.
* Make sure drbd_make_request knows about that.
* Usually we should be in some network failure state already,
* but just in case we are not, we fix it up here.
*/
conn_request_state(tconn, NS(conn, C_NETWORK_FAILURE), CS_HARD);

/* asender does not clean up anything. it must not interfere, either */
drbd_thread_stop(&tconn->asender);
drbd_free_sock(tconn);
Expand Down

0 comments on commit fea2c8e

Please sign in to comment.