commit 86cba30cb4c825409b694fba75325a8213755b44 Author: Lars Ellenberg Date: Thu Apr 1 15:13:19 2010 +0200 fix regression: attach while connected failed commit 16429a1c082cb08bca315a8f31485d58bddca613 Author: Philipp Reisner 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. diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c index 41ca61a..32c166d 100644 --- a/drbd/drbd_main.c +++ b/drbd/drbd_main.c @@ -932,7 +932,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;