diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-04-01 09:13:19 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-17 19:06:07 -0400 |
commit | e0f83012dc510b0be92ee2d59227a573a36777b8 (patch) | |
tree | 891cfe0ba0503f51db260ed189f3f760b85b274d | |
parent | e4f925e12ea5daaa9baf2dd5af9c4951721dae95 (diff) |
drbd: fix regression: attach while connected failed
commit e4f925e12ea5daaa9baf2dd5af9c4951721dae95
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>
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 8f84a9f58c99..b1ce5dc7c603 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -840,7 +840,12 @@ 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 = os.pdsk > D_OUTDATED ? D_OUTDATED : os.pdsk; | 843 | /* remap any consistent state to D_OUTDATED, |
844 | * but disallow "upgrade" of not even consistent states. | ||
845 | */ | ||
846 | ns.pdsk = | ||
847 | (D_DISKLESS < os.pdsk && os.pdsk < D_OUTDATED) | ||
848 | ? os.pdsk : D_OUTDATED; | ||
844 | break; | 849 | break; |
845 | case C_SYNC_SOURCE: | 850 | case C_SYNC_SOURCE: |
846 | ns.pdsk = D_INCONSISTENT; | 851 | ns.pdsk = D_INCONSISTENT; |