aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-06-30 15:43:06 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 16:57:49 +0100
commit2ffca4f3ee6c2d507c39689e5f569bcb0612d3ad (patch)
tree93ad00a897ba69a66d4a8919b92927e81ff24136 /drivers/block/drbd/drbd_main.c
parentd942ae44537669418a7cbfd916531d30513dbca8 (diff)
downloadlinux-2ffca4f3ee6c2d507c39689e5f569bcb0612d3ad.tar.gz
drbd: Improve compatibility with drbd's older than 8.3.7
Regression introduced with 8.3.11 commit: drbd: Take a more conservative approach when deciding max_bio_size Never ever tell an older drbd, that we support more than 32KiB in a single data request (packet). Never believe an older drbd, that is supports more than 32KiB in a single data request (packet) 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, 6 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 72b1dfa4b65..448de7bf822 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1075,6 +1075,12 @@ int drbd_send_sizes(struct drbd_conf *mdev, int trigger_reply, enum dds_flags fl
p = drbd_prepare_command(mdev, sock);
if (!p)
return -EIO;
+
+ if (mdev->tconn->agreed_pro_version <= 94)
+ max_bio_size = min_t(int, max_bio_size, DRBD_MAX_SIZE_H80_PACKET);
+ else if (mdev->tconn->agreed_pro_version < 100)
+ max_bio_size = min_t(int, max_bio_size, DRBD_MAX_BIO_SIZE_P95);
+
p->d_size = cpu_to_be64(d_size);
p->u_size = cpu_to_be64(u_size);
p->c_size = cpu_to_be64(trigger_reply ? 0 : drbd_get_capacity(mdev->this_bdev));