Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lars Ellenberg and committed by
Philipp Reisner
2f2abeae 506afb62

+2 -1
+2 -1
drivers/block/drbd/drbd_state.c
··· 1238 1238 sib.os = os; 1239 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 1243 clear_bit(CRASHED_PRIMARY, &device->flags); 1243 1244 if (device->p_uuid) 1244 1245 device->p_uuid[UI_FLAGS] &= ~((u64)2);