Skip to content

Commit

Permalink
drbd: Fix a potential issue with the DISCARD_CONCURRENT flag
Browse files Browse the repository at this point in the history
The DISCARD_CONCURRENT flag should be set on one node and cleared on the
other node.
As the code was before it was theoretical possible that a node accepts the
meta socket, but has to close it later on, and keeps the DISCARD_CONCURRENT
flag.
Correct this by moving the clear_bit(DISCARD_CONCURRENT) where the packet
gets sent.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Nov 9, 2012
1 parent 519b6d3 commit e959d08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,8 +901,6 @@ static int conn_connect(struct drbd_tconn *tconn)
msock.rbuf = tconn->meta.rbuf;
msock.socket = NULL;

clear_bit(DISCARD_CONCURRENT, &tconn->flags);

/* Assume that the peer only understands protocol 80 until we know better. */
tconn->agreed_pro_version = 80;

Expand All @@ -918,6 +916,7 @@ static int conn_connect(struct drbd_tconn *tconn)
sock.socket = s;
send_first_packet(tconn, &sock, P_INITIAL_DATA);
} else if (!msock.socket) {
clear_bit(DISCARD_CONCURRENT, &tconn->flags);
msock.socket = s;
send_first_packet(tconn, &msock, P_INITIAL_META);
} else {
Expand Down

0 comments on commit e959d08

Please sign in to comment.