aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-06-18 05:46:01 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-07-24 08:10:41 -0400
commit63a6d0bb3dd69afedb2b2952eb1d1e8340c11d0d (patch)
tree6c4a7b4f35345c1f409c3971899ffdd4be935fcc /drivers/block/drbd/drbd_main.c
parent0029d62434d9045bc3e8b2eb48ae696e30336e92 (diff)
drbd: call local-io-error handler early
In case we want to hard-reset from the local-io-error handler, we need to call it before notifying the peer or aborting local IO. Otherwise the peer will advance its data generation UUIDs even if secondary. This way, local io error looks like a "regular" node crash, which reduces the number of different failure cases. This may be useful in a bigger picture where crashed or otherwise "misbehaving" nodes are automatically re-deployed. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r--drivers/block/drbd/drbd_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 91a4853d9eeb..29a276425079 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1637,6 +1637,9 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1637 eh = mdev->ldev->dc.on_io_error; 1637 eh = mdev->ldev->dc.on_io_error;
1638 was_io_error = test_and_clear_bit(WAS_IO_ERROR, &mdev->flags); 1638 was_io_error = test_and_clear_bit(WAS_IO_ERROR, &mdev->flags);
1639 1639
1640 if (was_io_error && eh == EP_CALL_HELPER)
1641 drbd_khelper(mdev, "local-io-error");
1642
1640 /* Immediately allow completion of all application IO, 1643 /* Immediately allow completion of all application IO,
1641 * that waits for completion from the local disk, 1644 * that waits for completion from the local disk,
1642 * if this was a force-detach due to disk_timeout 1645 * if this was a force-detach due to disk_timeout
@@ -1672,9 +1675,6 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
1672 drbd_md_sync(mdev); 1675 drbd_md_sync(mdev);
1673 } 1676 }
1674 put_ldev(mdev); 1677 put_ldev(mdev);
1675
1676 if (was_io_error && eh == EP_CALL_HELPER)
1677 drbd_khelper(mdev, "local-io-error");
1678 } 1678 }
1679 1679
1680 /* second half of local IO error, failure to attach, 1680 /* second half of local IO error, failure to attach,