Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0f83012 authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner
Browse files

drbd: fix regression: attach while connected failed



commit e4f925e1
Author: Philipp Reisner <philipp.reisner@linbit.com>
Date:   Wed Mar 17 14:18:41 2010 +0100

    drbd: Do not upgrade state to Outdated if already Inconsistent

prevented the necessary state transition for attaching while connected
(Diskless -> Consistent respectively Outdated).
This is the fix for the fix.

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent e4f925e1
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -840,7 +840,12 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state
			break;
			break;
		case C_WF_BITMAP_S:
		case C_WF_BITMAP_S:
		case C_PAUSED_SYNC_S:
		case C_PAUSED_SYNC_S:
			ns.pdsk = os.pdsk > D_OUTDATED ? D_OUTDATED : os.pdsk;
			/* remap any consistent state to D_OUTDATED,
			 * but disallow "upgrade" of not even consistent states.
			 */
			ns.pdsk =
				(D_DISKLESS < os.pdsk && os.pdsk < D_OUTDATED)
				? os.pdsk : D_OUTDATED;
			break;
			break;
		case C_SYNC_SOURCE:
		case C_SYNC_SOURCE:
			ns.pdsk = D_INCONSISTENT;
			ns.pdsk = D_INCONSISTENT;