drbd: Do not cleanup resync LRU for the Ahead/Behind SyncSource/SyncTarget transitions
authorPhilipp Reisner <philipp.reisner@linbit.com>
Fri, 29 Oct 2010 10:44:20 +0000 (12:44 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 10 Mar 2011 10:34:51 +0000 (11:34 +0100)
This one should be replaced with moving this cleanup to the
'right' position.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_worker.c

index c9e7cb7c788abfd55623d45f21074a2d8b7ee78c..982d68432a0f5bbe97c47fcac9e126ee4fcd6807 100644 (file)
@@ -1485,8 +1485,13 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
                return;
        }
 
-       /* In case a previous resync run was aborted by an IO error/detach on the peer. */
-       drbd_rs_cancel_all(mdev);
+       if (mdev->state.conn < C_AHEAD) {
+               /* In case a previous resync run was aborted by an IO error/detach on the peer. */
+               drbd_rs_cancel_all(mdev);
+               /* This should be done when we abort the resync. We definitely do not
+                  want to have this for connections going back and forth between
+                  Ahead/Behind and SyncSource/SyncTarget */
+       }
 
        if (side == C_SYNC_TARGET) {
                /* Since application IO was locked out during C_WF_BITMAP_T and