Commit 38fa9988 authored by Philipp Reisner's avatar Philipp Reisner

drbd: Do not modify the connection state with something else that conn_request_state()

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 34f646bd
...@@ -769,7 +769,7 @@ static void drbd_try_clear_on_disk_bm(struct drbd_conf *mdev, sector_t sector, ...@@ -769,7 +769,7 @@ static void drbd_try_clear_on_disk_bm(struct drbd_conf *mdev, sector_t sector,
dump_stack(); dump_stack();
lc_put(mdev->resync, &ext->lce); lc_put(mdev->resync, &ext->lce);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
return; return;
} }
} else { } else {
......
...@@ -2922,7 +2922,7 @@ static int receive_protocol(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -2922,7 +2922,7 @@ static int receive_protocol(struct drbd_conf *mdev, enum drbd_packet cmd,
return true; return true;
disconnect: disconnect:
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
return false; return false;
} }
...@@ -3101,7 +3101,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -3101,7 +3101,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packet cmd,
crypto_free_hash(csums_tfm); crypto_free_hash(csums_tfm);
/* but free the verify_tfm again, if csums_tfm did not work out */ /* but free the verify_tfm again, if csums_tfm did not work out */
crypto_free_hash(verify_tfm); crypto_free_hash(verify_tfm);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
return false; return false;
} }
...@@ -3161,7 +3161,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -3161,7 +3161,7 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packet cmd,
mdev->state.disk >= D_OUTDATED && mdev->state.disk >= D_OUTDATED &&
mdev->state.conn < C_CONNECTED) { mdev->state.conn < C_CONNECTED) {
dev_err(DEV, "The peer's disk size is too small!\n"); dev_err(DEV, "The peer's disk size is too small!\n");
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
mdev->ldev->dc.disk_size = my_usize; mdev->ldev->dc.disk_size = my_usize;
put_ldev(mdev); put_ldev(mdev);
return false; return false;
...@@ -3237,7 +3237,7 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -3237,7 +3237,7 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packet cmd,
(mdev->ed_uuid & ~((u64)1)) != (p_uuid[UI_CURRENT] & ~((u64)1))) { (mdev->ed_uuid & ~((u64)1)) != (p_uuid[UI_CURRENT] & ~((u64)1))) {
dev_err(DEV, "Can only connect to data with current UUID=%016llX\n", dev_err(DEV, "Can only connect to data with current UUID=%016llX\n",
(unsigned long long)mdev->ed_uuid); (unsigned long long)mdev->ed_uuid);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
return false; return false;
} }
...@@ -3442,7 +3442,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -3442,7 +3442,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packet cmd,
if (test_and_clear_bit(CONN_DRY_RUN, &mdev->flags)) if (test_and_clear_bit(CONN_DRY_RUN, &mdev->flags))
return false; return false;
D_ASSERT(os.conn == C_WF_REPORT_PARAMS); D_ASSERT(os.conn == C_WF_REPORT_PARAMS);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
return false; return false;
} }
} }
...@@ -3467,7 +3467,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -3467,7 +3467,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packet cmd,
tl_clear(mdev->tconn); tl_clear(mdev->tconn);
drbd_uuid_new_current(mdev); drbd_uuid_new_current(mdev);
clear_bit(NEW_CUR_UUID, &mdev->flags); clear_bit(NEW_CUR_UUID, &mdev->flags);
drbd_force_state(mdev, NS2(conn, C_PROTOCOL_ERROR, susp, 0)); conn_request_state(mdev->tconn, NS2(conn, C_PROTOCOL_ERROR, susp, 0), CS_HARD);
return false; return false;
} }
rv = _drbd_set_state(mdev, ns, cs_flags, NULL); rv = _drbd_set_state(mdev, ns, cs_flags, NULL);
...@@ -3475,7 +3475,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -3475,7 +3475,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packet cmd,
spin_unlock_irq(&mdev->tconn->req_lock); spin_unlock_irq(&mdev->tconn->req_lock);
if (rv < SS_SUCCESS) { if (rv < SS_SUCCESS) {
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
return false; return false;
} }
...@@ -3648,7 +3648,7 @@ decode_bitmap_c(struct drbd_conf *mdev, ...@@ -3648,7 +3648,7 @@ decode_bitmap_c(struct drbd_conf *mdev,
* during all our tests. */ * during all our tests. */
dev_err(DEV, "receive_bitmap_c: unknown encoding %u\n", p->encoding); dev_err(DEV, "receive_bitmap_c: unknown encoding %u\n", p->encoding);
drbd_force_state(mdev, NS(conn, C_PROTOCOL_ERROR)); conn_request_state(mdev->tconn, NS(conn, C_PROTOCOL_ERROR), CS_HARD);
return -EIO; return -EIO;
} }
......
...@@ -1290,12 +1290,6 @@ int w_send_read_req(struct drbd_work *w, int cancel) ...@@ -1290,12 +1290,6 @@ int w_send_read_req(struct drbd_work *w, int cancel)
ok = drbd_send_drequest(mdev, P_DATA_REQUEST, req->i.sector, req->i.size, ok = drbd_send_drequest(mdev, P_DATA_REQUEST, req->i.sector, req->i.size,
(unsigned long)req); (unsigned long)req);
if (!ok) {
/* ?? we set C_TIMEOUT or C_BROKEN_PIPE in drbd_send();
* so this is probably redundant */
if (mdev->state.conn >= C_CONNECTED)
drbd_force_state(mdev, NS(conn, C_NETWORK_FAILURE));
}
req_mod(req, ok ? HANDED_OVER_TO_NETWORK : SEND_FAILED); req_mod(req, ok ? HANDED_OVER_TO_NETWORK : SEND_FAILED);
return ok; return ok;
...@@ -1510,7 +1504,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) ...@@ -1510,7 +1504,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
if (r > 0) { if (r > 0) {
dev_info(DEV, "before-resync-target handler returned %d, " dev_info(DEV, "before-resync-target handler returned %d, "
"dropping connection.\n", r); "dropping connection.\n", r);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
return; return;
} }
} else /* C_SYNC_SOURCE */ { } else /* C_SYNC_SOURCE */ {
...@@ -1523,7 +1517,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) ...@@ -1523,7 +1517,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
} else { } else {
dev_info(DEV, "before-resync-source handler returned %d, " dev_info(DEV, "before-resync-source handler returned %d, "
"dropping connection.\n", r); "dropping connection.\n", r);
drbd_force_state(mdev, NS(conn, C_DISCONNECTING)); conn_request_state(mdev->tconn, NS(conn, C_DISCONNECTING), CS_HARD);
return; return;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment