Commit 61610420 authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

drbd: in drbd_suspend_al, set AL_SUSPENDED before unlocking the activity log

As using an empty activity log is the whole point of the excercise,
make sure it is still empty when setting AL_SUSPENDED.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 867f5748
...@@ -901,19 +901,17 @@ static void drbd_suspend_al(struct drbd_conf *mdev) ...@@ -901,19 +901,17 @@ static void drbd_suspend_al(struct drbd_conf *mdev)
{ {
int s = 0; int s = 0;
if (lc_try_lock(mdev->act_log)) { if (!lc_try_lock(mdev->act_log)) {
drbd_al_shrink(mdev);
lc_unlock(mdev->act_log);
} else {
dev_warn(DEV, "Failed to lock al in drbd_suspend_al()\n"); dev_warn(DEV, "Failed to lock al in drbd_suspend_al()\n");
return; return;
} }
drbd_al_shrink(mdev);
spin_lock_irq(&mdev->tconn->req_lock); spin_lock_irq(&mdev->tconn->req_lock);
if (mdev->state.conn < C_CONNECTED) if (mdev->state.conn < C_CONNECTED)
s = !test_and_set_bit(AL_SUSPENDED, &mdev->flags); s = !test_and_set_bit(AL_SUSPENDED, &mdev->flags);
spin_unlock_irq(&mdev->tconn->req_lock); spin_unlock_irq(&mdev->tconn->req_lock);
lc_unlock(mdev->act_log);
if (s) if (s)
dev_info(DEV, "Suspended AL updates\n"); dev_info(DEV, "Suspended AL updates\n");
......
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