diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2014-04-28 12:43:33 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-04-30 15:46:56 -0400 |
commit | 02df6fe145715f1d3858c0c65aed991f148b70b4 (patch) | |
tree | 4e9e2870cd412665c58131222ad9f5572058f491 | |
parent | c1b3156f121fd301191e0b4c5fa2fec42cd17871 (diff) |
drbd: Test cstate while holding req_lock
In case a connection transitions into C_TIMEOUT within the timer
function (request_timer_fn()) we need to make sure that the receiver
thread (potentially running on a different CPU) sees the updated
cstate later on.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 3 | ||||
-rw-r--r-- | include/linux/drbd.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index b4fc401b587f..f4d3aff89aa1 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -442,12 +442,13 @@ bool conn_try_outdate_peer(struct drbd_connection *connection) | |||
442 | char *ex_to_string; | 442 | char *ex_to_string; |
443 | int r; | 443 | int r; |
444 | 444 | ||
445 | spin_lock_irq(&connection->resource->req_lock); | ||
445 | if (connection->cstate >= C_WF_REPORT_PARAMS) { | 446 | if (connection->cstate >= C_WF_REPORT_PARAMS) { |
446 | drbd_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n"); | 447 | drbd_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n"); |
448 | spin_unlock_irq(&connection->resource->req_lock); | ||
447 | return false; | 449 | return false; |
448 | } | 450 | } |
449 | 451 | ||
450 | spin_lock_irq(&connection->resource->req_lock); | ||
451 | connect_cnt = connection->connect_cnt; | 452 | connect_cnt = connection->connect_cnt; |
452 | spin_unlock_irq(&connection->resource->req_lock); | 453 | spin_unlock_irq(&connection->resource->req_lock); |
453 | 454 | ||
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index fffd4b8563cb..3dbe9bd57a09 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -52,7 +52,7 @@ | |||
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | extern const char *drbd_buildtag(void); | 54 | extern const char *drbd_buildtag(void); |
55 | #define REL_VERSION "8.4.4" | 55 | #define REL_VERSION "8.4.3" |
56 | #define API_VERSION 1 | 56 | #define API_VERSION 1 |
57 | #define PRO_VERSION_MIN 86 | 57 | #define PRO_VERSION_MIN 86 |
58 | #define PRO_VERSION_MAX 101 | 58 | #define PRO_VERSION_MAX 101 |