summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2011-10-06 17:30:26 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-05-09 15:15:54 +0200
commita2e9138197405a4c051630416ceebf98158e631d (patch)
tree260a4976065d1efc85bc73d1a7c7be8c2416bb7a
parentdrbd: Fixed a race condition between detach and start of resync (diff)
downloadlinux-a2e9138197405a4c051630416ceebf98158e631d.tar.xz
linux-a2e9138197405a4c051630416ceebf98158e631d.zip
drbd: fix spurious meta data IO "error"
When detaching, even cleanly detaching due to administrator request, we always go through D_FAILED before we become D_DISKLESS. Don't let that state change race with an in-flight meta data IO, or that one might think it actually experienced an IO error. 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_nl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 1a81d9ed1b24..00a82ab7ab98 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1351,7 +1351,9 @@ static int drbd_nl_detach(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
}
drbd_suspend_io(mdev); /* so no-one is stuck in drbd_al_begin_io */
+ drbd_md_get_buffer(mdev); /* make sure there is no in-flight meta-data IO */
retcode = drbd_request_state(mdev, NS(disk, D_FAILED));
+ drbd_md_put_buffer(mdev);
/* D_FAILED will transition to DISKLESS. */
ret = wait_event_interruptible(mdev->misc_wait,
mdev->state.disk != D_FAILED);