diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2014-03-27 05:34:13 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2014-07-10 12:35:05 -0400 |
commit | 2f2abeae3cd139fb3581249388bf2018612a87e5 (patch) | |
tree | 876f577c3153008b9833609d5e4c91b62a634048 | |
parent | 506afb6248af577eb702c73f3da52a12f4c56a38 (diff) |
drbd: clear CRASHED_PRIMARY only after successful resync
If we lost a disk during the first resync after primary crash,
we could have prematurely cleared the CRASHED_PRIMARY flag.
Testing on C_CONNECTED is not what we meant there,
but testing for both peers to become D_UP_TO_DATE.
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_state.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 4a75b7a03b9d..c35c0f001bb7 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c | |||
@@ -1238,7 +1238,8 @@ static void after_state_ch(struct drbd_device *device, union drbd_state os, | |||
1238 | sib.os = os; | 1238 | sib.os = os; |
1239 | sib.ns = ns; | 1239 | sib.ns = ns; |
1240 | 1240 | ||
1241 | if (os.conn != C_CONNECTED && ns.conn == C_CONNECTED) { | 1241 | if ((os.disk != D_UP_TO_DATE || os.pdsk != D_UP_TO_DATE) |
1242 | && (ns.disk == D_UP_TO_DATE && ns.pdsk == D_UP_TO_DATE)) { | ||
1242 | clear_bit(CRASHED_PRIMARY, &device->flags); | 1243 | clear_bit(CRASHED_PRIMARY, &device->flags); |
1243 | if (device->p_uuid) | 1244 | if (device->p_uuid) |
1244 | device->p_uuid[UI_FLAGS] &= ~((u64)2); | 1245 | device->p_uuid[UI_FLAGS] &= ~((u64)2); |