mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 13/19] drbd: drbdsetup detach of an unresponsive local disk should not block IO "forever"
Date: Thu, 30 Jul 2015 13:21:48 +0200	[thread overview]
Message-ID: <1438255314-14877-14-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1438255314-14877-1-git-send-email-philipp.reisner@linbit.com>

From: Lars Ellenberg <lars.ellenberg@linbit.com>

When detaching, we make sure no application IO is in-flight
by internally suspending IO, then trigger the state change,
wait for the result, and finally internally resume IO again.

Once we triggered the stat change to "Failed",
we expect it to change from Failed to Diskless.
(To avoid races, we actually wait for it to leave "Failed").

On an unresponsive local IO backend, this may not happen, ever.
Don't have a "hung" detach block IO "forever", but resume IO
before waiting for the state change to Diskless.

We may well be able to continue IO to and from a healthy peer.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
 drivers/block/drbd/drbd_nl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 2178fb7..7229d8e 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1929,9 +1929,9 @@ static int adm_detach(struct drbd_device *device, int force)
 	retcode = drbd_request_state(device, NS(disk, D_FAILED));
 	drbd_md_put_buffer(device);
 	/* D_FAILED will transition to DISKLESS. */
+	drbd_resume_io(device);
 	ret = wait_event_interruptible(device->misc_wait,
 			device->state.disk != D_FAILED);
-	drbd_resume_io(device);
 	if ((int)retcode == (int)SS_IS_DISKLESS)
 		retcode = SS_NOTHING_TO_DO;
 	if (ret)
-- 
1.9.1


  parent reply	other threads:[~2015-07-30 11:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 11:21 [PATCH 00/19] RFC DRBD updates for the 4.3 merge window Philipp Reisner
2015-07-30 11:21 ` [PATCH 01/19] drbd: Remove pointless check Philipp Reisner
2015-07-30 11:21 ` [PATCH 02/19] drbd: De-inline drbd_should_do_remote() and drbd_should_send_out_of_sync() Philipp Reisner
2015-07-30 11:21 ` [PATCH 03/19] drbd: Get rid of some first_peer_device() calls Philipp Reisner
2015-07-30 11:21 ` [PATCH 04/19] drbd: Move enum write_ordering_e to drbd.h Philipp Reisner
2015-07-30 11:21 ` [PATCH 05/19] drbd: drbd_adm_attach(): Add missing drbd_resync_after_changed() Philipp Reisner
2015-07-30 11:21 ` [PATCH 06/19] drbd: Fix locking across all resources Philipp Reisner
2015-07-30 11:21 ` [PATCH 07/19] drbd: Backport the "events2" command Philipp Reisner
2015-07-30 11:21 ` [PATCH 08/19] drbd: Backport the "status" command Philipp Reisner
2015-07-30 11:21 ` [PATCH 09/19] drbd: Deletion of an unnecessary check before the function call "lc_destroy" Philipp Reisner
2015-07-30 11:21 ` [PATCH 10/19] drbd: Replace 0 with the more meaningful GFP_NOWAIT Philipp Reisner
2015-07-30 11:21 ` [PATCH 11/19] drbd: Fix spurious disk-timeout Philipp Reisner
2015-07-30 11:21 ` [PATCH 12/19] drbd: drop remnants of connector -- we don't use it anymore in drbd 8.4 Philipp Reisner
2015-07-30 11:21 ` Philipp Reisner [this message]
2015-07-30 11:21 ` [PATCH 14/19] drbd: also bump UUIDs if a diskless primary connects Philipp Reisner
2015-07-30 11:21 ` [PATCH 15/19] drbd: add comment why we want to first call local-io-error, then send state Philipp Reisner
2015-07-30 11:21 ` [PATCH 16/19] drbd: drbd_panic_after_delayed_completion_of_aborted_request() Philipp Reisner
2015-07-30 11:21 ` [PATCH 17/19] drbd: improve network timeout detection Philipp Reisner
2015-07-30 11:21 ` [PATCH 18/19] drbd: fix NULL deref in remember_new_state Philipp Reisner
2015-07-30 11:21 ` [PATCH 19/19] drbd: fix refcount error during detach of an already failed disk Philipp Reisner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438255314-14877-14-git-send-email-philipp.reisner@linbit.com \
    --to=philipp.reisner@linbit.com \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®