drbd: Test cstate while holding req_lock
authorPhilipp Reisner <philipp.reisner@linbit.com>
Mon, 28 Apr 2014 16:43:33 +0000 (18:43 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 30 Apr 2014 19:46:56 +0000 (13:46 -0600)
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>
drivers/block/drbd/drbd_nl.c
include/linux/drbd.h

index b4fc401b587fb847f82d1cc7ed96aba23ae3f2f8..f4d3aff89aa18343db0ab00bcc8aeddcd536a21f 100644 (file)
@@ -442,12 +442,13 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
        char *ex_to_string;
        int r;
 
+       spin_lock_irq(&connection->resource->req_lock);
        if (connection->cstate >= C_WF_REPORT_PARAMS) {
                drbd_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n");
+               spin_unlock_irq(&connection->resource->req_lock);
                return false;
        }
 
-       spin_lock_irq(&connection->resource->req_lock);
        connect_cnt = connection->connect_cnt;
        spin_unlock_irq(&connection->resource->req_lock);
 
index fffd4b8563cb493c8f2907d88b4e1a4c79609bd9..3dbe9bd57a094b9b63175de44d6f9fd1022c322b 100644 (file)
@@ -52,7 +52,7 @@
 #endif
 
 extern const char *drbd_buildtag(void);
-#define REL_VERSION "8.4.4"
+#define REL_VERSION "8.4.3"
 #define API_VERSION 1
 #define PRO_VERSION_MIN 86
 #define PRO_VERSION_MAX 101
This page took 0.036324 seconds and 5 git commands to generate.