dect
/
linux-2.6
Archived
13
0
Fork 0

drbd: fix regression: attach while connected failed

commit e4f925e12e
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: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
Lars Ellenberg 2010-04-01 15:13:19 +02:00 committed by Philipp Reisner
parent e4f925e12e
commit e0f83012dc
1 changed files with 6 additions and 1 deletions

View File

@ -840,7 +840,12 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state
break;
case C_WF_BITMAP_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;
case C_SYNC_SOURCE:
ns.pdsk = D_INCONSISTENT;