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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Philipp Reisner authored and Jens Axboe committed Oct 30, 2012
1 parent 02b91b5 commit c12a3d8
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 @@ -763,8 +763,6 @@ static int drbd_connect(struct drbd_conf *mdev)
if (drbd_request_state(mdev, NS(conn, C_WF_CONNECTION)) < SS_SUCCESS)
return -2;

clear_bit(DISCARD_CONCURRENT, &mdev->flags);

sock = NULL;
msock = NULL;

Expand All @@ -784,6 +782,7 @@ static int drbd_connect(struct drbd_conf *mdev)
sock = s;
s = NULL;
} else if (!msock) {
clear_bit(DISCARD_CONCURRENT, &mdev->flags);
drbd_send_fp(mdev, s, P_HAND_SHAKE_M);
msock = s;
s = NULL;
Expand Down

0 comments on commit c12a3d8

Please sign in to comment.