提交 02df6fe1 编写于 作者: P Philipp Reisner 提交者: Jens Axboe

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: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 c1b3156f
...@@ -442,12 +442,13 @@ bool conn_try_outdate_peer(struct drbd_connection *connection) ...@@ -442,12 +442,13 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
char *ex_to_string; char *ex_to_string;
int r; int r;
spin_lock_irq(&connection->resource->req_lock);
if (connection->cstate >= C_WF_REPORT_PARAMS) { if (connection->cstate >= C_WF_REPORT_PARAMS) {
drbd_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n"); drbd_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n");
spin_unlock_irq(&connection->resource->req_lock);
return false; return false;
} }
spin_lock_irq(&connection->resource->req_lock);
connect_cnt = connection->connect_cnt; connect_cnt = connection->connect_cnt;
spin_unlock_irq(&connection->resource->req_lock); spin_unlock_irq(&connection->resource->req_lock);
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#endif #endif
extern const char *drbd_buildtag(void); extern const char *drbd_buildtag(void);
#define REL_VERSION "8.4.4" #define REL_VERSION "8.4.3"
#define API_VERSION 1 #define API_VERSION 1
#define PRO_VERSION_MIN 86 #define PRO_VERSION_MIN 86
#define PRO_VERSION_MAX 101 #define PRO_VERSION_MAX 101
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册