diff options
author | Adam Gandelman <adam.gandelman@linbit.com> | 2010-04-08 19:48:23 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-17 19:13:33 -0400 |
commit | 3a11a4878939e0e3c355bf3f52ef642a4cb6ba84 (patch) | |
tree | 43fb6bddbdc968e7d9e2657b8dca585c1c6d5788 /drivers/block/drbd | |
parent | 979f5c7f1f6c8a532b943defb790d43b999934eb (diff) |
drbd: New handler: initial-split-brain
Some wish to be notified of all instances of split brain, not just those that
go unresolved. The initial-split-brain handler is called to notify someone
upon detection of all split brain conditions even if auto-recovery policies
are configured.
Signed-off-by: Adam Gandelman <adam.gandelman@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 3a36bc814e77..6876041fc3d8 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -2487,6 +2487,9 @@ static enum drbd_conns drbd_sync_handshake(struct drbd_conf *mdev, enum drbd_rol | |||
2487 | hg > 0 ? "source" : "target"); | 2487 | hg > 0 ? "source" : "target"); |
2488 | } | 2488 | } |
2489 | 2489 | ||
2490 | if (abs(hg) == 100) | ||
2491 | drbd_khelper(mdev, "initial-split-brain"); | ||
2492 | |||
2490 | if (hg == 100 || (hg == -100 && mdev->net_conf->always_asbp)) { | 2493 | if (hg == 100 || (hg == -100 && mdev->net_conf->always_asbp)) { |
2491 | int pcount = (mdev->state.role == R_PRIMARY) | 2494 | int pcount = (mdev->state.role == R_PRIMARY) |
2492 | + (peer_role == R_PRIMARY); | 2495 | + (peer_role == R_PRIMARY); |
@@ -2532,7 +2535,7 @@ static enum drbd_conns drbd_sync_handshake(struct drbd_conf *mdev, enum drbd_rol | |||
2532 | * after an attempted attach on a diskless node. | 2535 | * after an attempted attach on a diskless node. |
2533 | * We just refuse to attach -- well, we drop the "connection" | 2536 | * We just refuse to attach -- well, we drop the "connection" |
2534 | * to that disk, in a way... */ | 2537 | * to that disk, in a way... */ |
2535 | dev_alert(DEV, "Split-Brain detected, dropping connection!\n"); | 2538 | dev_alert(DEV, "Split-Brain detected but unresolved, dropping connection!\n"); |
2536 | drbd_khelper(mdev, "split-brain"); | 2539 | drbd_khelper(mdev, "split-brain"); |
2537 | return C_MASK; | 2540 | return C_MASK; |
2538 | } | 2541 | } |