summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ellenberg <lars@linbit.com>2014-04-28 18:43:27 +0200
committerJens Axboe <axboe@fb.com>2014-04-30 13:46:55 -0600
commitfa090e708a72f0ea9cbe067fba28cfb2b8b787af (patch)
tree833888d8d49aad936ac5e9e650cf0abee55e7e5c
parent074f4afeb2277bd5ecb9fa7f91eaffa55e262126 (diff)
downloadlwn-fa090e708a72f0ea9cbe067fba28cfb2b8b787af.tar.gz
lwn-fa090e708a72f0ea9cbe067fba28cfb2b8b787af.zip
drbd: keep max-bio size during detach/attach on disconnected primary
We want to store in persistent meta data what the peer DRBD can handle, which, due to spreading requests to multiple bios, may be more than its backing device can handle. Otherwise, if a disconnected Primary temporarily loses access to its local data as well, we may accidentally shrink the max-bio setting, portentially causing already assembled, but not yet processed, application bios to be spuriously failed due to device limits. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--drivers/block/drbd/drbd_nl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 2364b781d9ac..a187c5b0da27 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1194,8 +1194,14 @@ void drbd_reconsider_max_bio_size(struct drbd_device *device)
peer = DRBD_MAX_BIO_SIZE_P95; /* drbd 8.3.8 onwards, before 8.4.0 */
else
peer = DRBD_MAX_BIO_SIZE;
- }
+ /* We may later detach and re-attach on a disconnected Primary.
+ * Avoid this setting to jump back in that case.
+ * We want to store what we know the peer DRBD can handle,
+ * not what the peer IO backend can handle. */
+ if (peer > device->peer_max_bio_size)
+ device->peer_max_bio_size = peer;
+ }
new = min(local, peer);
if (device->state.role == R_PRIMARY && new < now)