aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-08-03 19:07:55 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-09 08:05:47 -0500
commite959d08d3ef6e48bc3b726bcc07a4ebb9989be94 (patch)
treedf3abd787e46ed66c1bdfe1a2be1f8b256c54988
parent519b6d3eac823e4ceec10484bc06f239047cebbf (diff)
drbd: Fix a potential issue with the DISCARD_CONCURRENT flag
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>
-rw-r--r--drivers/block/drbd/drbd_receiver.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 26c30fd64ecf..d507700df85c 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -901,8 +901,6 @@ static int conn_connect(struct drbd_tconn *tconn)
901 msock.rbuf = tconn->meta.rbuf; 901 msock.rbuf = tconn->meta.rbuf;
902 msock.socket = NULL; 902 msock.socket = NULL;
903 903
904 clear_bit(DISCARD_CONCURRENT, &tconn->flags);
905
906 /* Assume that the peer only understands protocol 80 until we know better. */ 904 /* Assume that the peer only understands protocol 80 until we know better. */
907 tconn->agreed_pro_version = 80; 905 tconn->agreed_pro_version = 80;
908 906
@@ -918,6 +916,7 @@ static int conn_connect(struct drbd_tconn *tconn)
918 sock.socket = s; 916 sock.socket = s;
919 send_first_packet(tconn, &sock, P_INITIAL_DATA); 917 send_first_packet(tconn, &sock, P_INITIAL_DATA);
920 } else if (!msock.socket) { 918 } else if (!msock.socket) {
919 clear_bit(DISCARD_CONCURRENT, &tconn->flags);
921 msock.socket = s; 920 msock.socket = s;
922 send_first_packet(tconn, &msock, P_INITIAL_META); 921 send_first_packet(tconn, &msock, P_INITIAL_META);
923 } else { 922 } else {