Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199798

[PATCH 12/19] drbd: don't block forever in disconnect during resync if fencing=r-a-stonith

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!bofh.it!news.nic.it!robomod
From Philipp Reisner <philipp.reisner@linbit.com>
Newsgroups linux.kernel
Subject [PATCH 12/19] drbd: don't block forever in disconnect during resync if fencing=r-a-stonith
Date Tue, 04 Aug 2015 15:00:04 +0200
Message-ID <pTJZ2-2yz-37@gated-at.bofh.it> (permalink)
References <pTJZ0-2yz-9@gated-at.bofh.it>
X-Original-To linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc drbd-dev@lists.linbit.com
X-Original-Date Tue, 4 Aug 2015 14:56:36 +0200
X-Original-Message-ID <1438693003-17554-13-git-send-email-philipp.reisner@linbit.com>
X-Original-References <1438693003-17554-1-git-send-email-philipp.reisner@linbit.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1199798

Show key headers only | View raw


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

Disconnect should wait for pending bitmap IO.
But if that bitmap IO is not happening, because it is waiting for
pending application IO, and there is no progress, because the fencing
policy suspended application IO because of the disconnect,
then we deadlock.

The bitmap writeout in this case does not care for concurrent
application IO, so there is no point waiting for it.

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

diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index fea97fe..d26ddb6 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -3564,7 +3564,9 @@ void drbd_queue_bitmap_io(struct drbd_device *device,
 
 	spin_lock_irq(&device->resource->req_lock);
 	set_bit(BITMAP_IO, &device->flags);
-	if (atomic_read(&device->ap_bio_cnt) == 0) {
+	/* don't wait for pending application IO if the caller indicates that
+	 * application IO does not conflict anyways. */
+	if (flags == BM_LOCKED_CHANGE_ALLOWED || atomic_read(&device->ap_bio_cnt) == 0) {
 		if (!test_and_set_bit(BITMAP_IO_QUEUED, &device->flags))
 			drbd_queue_work(&first_peer_device(device)->connection->sender_work,
 					&device->bm_io_work.w);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 12/19] drbd: don't block forever in disconnect during resync if fencing=r-a-stonith Philipp Reisner <philipp.reisner@linbit.com> - 2015-08-04 15:00 +0200

csiph-web