aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-03-17 09:18:41 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-05-17 19:01:05 -0400
commite4f925e12ea5daaa9baf2dd5af9c4951721dae95 (patch)
tree1a4022d30e051a58ef68734f11f9db62f9078fad
parent8c484ee4910b36c9ac273ad1150261c6ebfc1ef7 (diff)
drbd: Do not upgrade state to Outdated if already Inconsistent [Bugz 277]
There was a race condition: In a situation with a SyncSource+Primary and a SyncTarget+Secondary node, and a resync dependency to some other device. After both nodes decided to do the resync, the other device finishes its resync process. At that time SyncSource already sent the P_SYNC_UUID packet, and already updated its peer disk state to Inconsistent. The SyncTarget node waits for the P_SYNC_UUID and sends a state packet to report the resync dependency change. That packet still carries a disk state of Outdated. Impact: If application writes come in, during that time on the Primary node, those do not get replicated, and the out-of-sync counter gets increased. => The completion of resync is not detected on the primary node. => stalled. Those blocks get resync'ed with the next resync, since the are get marked as out-of-sync in the bitmap. In order to fix this, we filter out that wrong state change in the sanitize_state() function. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index db7a07a9a2cf..8f84a9f58c99 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -840,7 +840,7 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state
840 break; 840 break;
841 case C_WF_BITMAP_S: 841 case C_WF_BITMAP_S:
842 case C_PAUSED_SYNC_S: 842 case C_PAUSED_SYNC_S:
843 ns.pdsk = D_OUTDATED; 843 ns.pdsk = os.pdsk > D_OUTDATED ? D_OUTDATED : os.pdsk;
844 break; 844 break;
845 case C_SYNC_SOURCE: 845 case C_SYNC_SOURCE:
846 ns.pdsk = D_INCONSISTENT; 846 ns.pdsk = D_INCONSISTENT;