diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-06-30 09:43:06 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-05-09 04:08:57 -0400 |
commit | 6809384c7152c34e74e29a4033826a300eb94f11 (patch) | |
tree | 814cd296ad8e8ca958d5ebc1571eec581c6062de /drivers/block | |
parent | 77e8fdfc188f0490754f703f80d2853c69052c12 (diff) |
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')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 4 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 8e83a402ed5c..a15135b9b60a 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2112,6 +2112,10 @@ int drbd_send_sizes(struct drbd_conf *mdev, int trigger_reply, enum dds_flags fl | |||
2112 | max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */ | 2112 | max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */ |
2113 | } | 2113 | } |
2114 | 2114 | ||
2115 | /* Never allow old drbd (up to 8.3.7) to see more than 32KiB */ | ||
2116 | if (mdev->agreed_pro_version <= 94) | ||
2117 | max_bio_size = min_t(int, max_bio_size, DRBD_MAX_SIZE_H80_PACKET); | ||
2118 | |||
2115 | p.d_size = cpu_to_be64(d_size); | 2119 | p.d_size = cpu_to_be64(d_size); |
2116 | p.u_size = cpu_to_be64(u_size); | 2120 | p.u_size = cpu_to_be64(u_size); |
2117 | p.c_size = cpu_to_be64(trigger_reply ? 0 : drbd_get_capacity(mdev->this_bdev)); | 2121 | p.c_size = cpu_to_be64(trigger_reply ? 0 : drbd_get_capacity(mdev->this_bdev)); |
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index f7b5f7e86a57..cabad39f908c 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -845,9 +845,10 @@ void drbd_reconsider_max_bio_size(struct drbd_conf *mdev) | |||
845 | Because new from 8.3.8 onwards the peer can use multiple | 845 | Because new from 8.3.8 onwards the peer can use multiple |
846 | BIOs for a single peer_request */ | 846 | BIOs for a single peer_request */ |
847 | if (mdev->state.conn >= C_CONNECTED) { | 847 | if (mdev->state.conn >= C_CONNECTED) { |
848 | if (mdev->agreed_pro_version < 94) | 848 | if (mdev->agreed_pro_version < 94) { |
849 | peer = mdev->peer_max_bio_size; | 849 | peer = min_t(int, mdev->peer_max_bio_size, DRBD_MAX_SIZE_H80_PACKET); |
850 | else if (mdev->agreed_pro_version == 94) | 850 | /* Correct old drbd (up to 8.3.7) if it believes it can do more than 32KiB */ |
851 | } else if (mdev->agreed_pro_version == 94) | ||
851 | peer = DRBD_MAX_SIZE_H80_PACKET; | 852 | peer = DRBD_MAX_SIZE_H80_PACKET; |
852 | else /* drbd 8.3.8 onwards */ | 853 | else /* drbd 8.3.8 onwards */ |
853 | peer = DRBD_MAX_BIO_SIZE; | 854 | peer = DRBD_MAX_BIO_SIZE; |