Skip to content

Commit

Permalink
drbd: properly call drbd_rs_cancel_all() in drbd_disconnected()
Browse files Browse the repository at this point in the history
drbd_disconnected() is supposed to clear the resync lru cache,
by calling drbd_rs_cancel_all().

We must do so before we call drbd_flush_workqueue(), as at least the
callback w_restart_disk_io() may wait for resync progres, and would
otherwise deadlock.

drbd_finish_peer_reqs() may again populate that cache, which will
then potentially be stale after the next resync handshake and bitmap
exchange, we have to do it again after that.

A stale resync lru cache causes no harm but ugly messages like this:
 BAD! sector=196608s enr=6 rs_left=-256 rs_failed=0 count=256 cstate=SyncTarget

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Nov 9, 2012
1 parent 155522d commit 08332d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4526,6 +4526,10 @@ static int drbd_disconnected(struct drbd_conf *mdev)
necessary to reclain net_ee in drbd_finish_peer_reqs(). */
drbd_flush_workqueue(mdev);

/* need to do it again, drbd_finish_peer_reqs() may have populated it
* again via drbd_try_clear_on_disk_bm(). */
drbd_rs_cancel_all(mdev);

kfree(mdev->p_uuid);
mdev->p_uuid = NULL;

Expand Down

0 comments on commit 08332d7

Please sign in to comment.