Commit a18e9d1e authored by Philipp Reisner's avatar Philipp Reisner

drbd: Removed the OBJECT_DYING and the CONFIG_PENDING bits

superseded by refcounting
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 0ace9dfa
...@@ -816,12 +816,6 @@ enum { ...@@ -816,12 +816,6 @@ enum {
GOT_PING_ACK, /* set when we receive a ping_ack packet, ping_wait gets woken */ GOT_PING_ACK, /* set when we receive a ping_ack packet, ping_wait gets woken */
CONN_WD_ST_CHG_OKAY, CONN_WD_ST_CHG_OKAY,
CONN_WD_ST_CHG_FAIL, CONN_WD_ST_CHG_FAIL,
CONFIG_PENDING, /* serialization of (re)configuration requests.
* if set, also prevents the device from dying */
OBJECT_DYING, /* device became unconfigured,
* but worker thread is still handling the cleanup.
* reconfiguring (nl_disk_conf, nl_net_conf) is dissalowed,
* while this is set. */
CONN_DRY_RUN, /* Expect disconnect after resync handshake. */ CONN_DRY_RUN, /* Expect disconnect after resync handshake. */
}; };
......
...@@ -1040,34 +1040,20 @@ void drbd_reconsider_max_bio_size(struct drbd_conf *mdev) ...@@ -1040,34 +1040,20 @@ void drbd_reconsider_max_bio_size(struct drbd_conf *mdev)
drbd_setup_queue_param(mdev, new); drbd_setup_queue_param(mdev, new);
} }
/* serialize deconfig (worker exiting, doing cleanup) /* Starts the worker thread */
* and reconfig (drbdsetup disk, drbdsetup net)
*
* Wait for a potentially exiting worker, then restart it,
* or start a new one. Flush any pending work, there may still be an
* after_state_change queued.
*/
static void conn_reconfig_start(struct drbd_tconn *tconn) static void conn_reconfig_start(struct drbd_tconn *tconn)
{ {
wait_event(tconn->ping_wait, !test_and_set_bit(CONFIG_PENDING, &tconn->flags));
wait_event(tconn->ping_wait, !test_bit(OBJECT_DYING, &tconn->flags));
drbd_thread_start(&tconn->worker); drbd_thread_start(&tconn->worker);
conn_flush_workqueue(tconn); conn_flush_workqueue(tconn);
} }
/* if still unconfigured, stops worker again. /* if still unconfigured, stops worker again. */
* if configured now, clears CONFIG_PENDING.
* wakes potential waiters */
static void conn_reconfig_done(struct drbd_tconn *tconn) static void conn_reconfig_done(struct drbd_tconn *tconn)
{ {
spin_lock_irq(&tconn->req_lock); spin_lock_irq(&tconn->req_lock);
if (conn_all_vols_unconf(tconn)) { if (conn_all_vols_unconf(tconn))
set_bit(OBJECT_DYING, &tconn->flags);
drbd_thread_stop_nowait(&tconn->worker); drbd_thread_stop_nowait(&tconn->worker);
} else
clear_bit(CONFIG_PENDING, &tconn->flags);
spin_unlock_irq(&tconn->req_lock); spin_unlock_irq(&tconn->req_lock);
wake_up(&tconn->ping_wait);
} }
/* Make sure IO is suspended before calling this function(). */ /* Make sure IO is suspended before calling this function(). */
......
...@@ -926,18 +926,6 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns, ...@@ -926,18 +926,6 @@ __drbd_set_state(struct drbd_conf *mdev, union drbd_state ns,
mdev->tconn->susp_nod = ns.susp_nod; mdev->tconn->susp_nod = ns.susp_nod;
mdev->tconn->susp_fen = ns.susp_fen; mdev->tconn->susp_fen = ns.susp_fen;
/* solve the race between becoming unconfigured,
* worker doing the cleanup, and
* admin reconfiguring us:
* on (re)configure, first set CONFIG_PENDING,
* then wait for a potentially exiting worker,
* start the worker, and schedule one no_op.
* then proceed with configuration.
*/
if(conn_all_vols_unconf(mdev->tconn) &&
!test_and_set_bit(CONFIG_PENDING, &mdev->tconn->flags))
set_bit(OBJECT_DYING, &mdev->tconn->flags);
if (os.disk == D_ATTACHING && ns.disk >= D_NEGOTIATING) if (os.disk == D_ATTACHING && ns.disk >= D_NEGOTIATING)
drbd_print_uuids(mdev, "attached to UUIDs"); drbd_print_uuids(mdev, "attached to UUIDs");
...@@ -1401,10 +1389,8 @@ struct after_conn_state_chg_work { ...@@ -1401,10 +1389,8 @@ struct after_conn_state_chg_work {
static void after_all_state_ch(struct drbd_tconn *tconn) static void after_all_state_ch(struct drbd_tconn *tconn)
{ {
if (conn_all_vols_unconf(tconn) && if (conn_all_vols_unconf(tconn))
test_bit(OBJECT_DYING, &tconn->flags)) {
drbd_thread_stop_nowait(&tconn->worker); drbd_thread_stop_nowait(&tconn->worker);
}
} }
static int w_after_conn_state_ch(struct drbd_work *w, int unused) static int w_after_conn_state_ch(struct drbd_work *w, int unused)
......
...@@ -1754,9 +1754,6 @@ int drbd_worker(struct drbd_thread *thi) ...@@ -1754,9 +1754,6 @@ int drbd_worker(struct drbd_thread *thi)
drbd_mdev_cleanup(mdev); drbd_mdev_cleanup(mdev);
} }
up_read(&drbd_cfg_rwsem); up_read(&drbd_cfg_rwsem);
clear_bit(OBJECT_DYING, &tconn->flags);
clear_bit(CONFIG_PENDING, &tconn->flags);
wake_up(&tconn->ping_wait);
return 0; return 0;
} }
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