diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-09-14 09:56:29 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-10-14 12:38:41 -0400 |
commit | 8979d9c9e0bc8e54cf5bd7a89abb2145f087b5e1 (patch) | |
tree | 2e22d97889ec466d954dd9db39de6b9ba5564703 /drivers/block | |
parent | fb22c402ffdf61dd121795b5809de587185d5240 (diff) |
drbd: protocol compatibility for maximum packet sizes
Two missing corner cases to the "maximum packet size" handshake.
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_nl.c | 18 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 9ee44568dce3..9ae33a5bcf66 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -861,6 +861,7 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp | |||
861 | struct inode *inode, *inode2; | 861 | struct inode *inode, *inode2; |
862 | struct lru_cache *resync_lru = NULL; | 862 | struct lru_cache *resync_lru = NULL; |
863 | union drbd_state ns, os; | 863 | union drbd_state ns, os; |
864 | unsigned int max_seg_s; | ||
864 | int rv; | 865 | int rv; |
865 | int cp_discovered = 0; | 866 | int cp_discovered = 0; |
866 | int logical_block_size; | 867 | int logical_block_size; |
@@ -1133,9 +1134,20 @@ static int drbd_nl_disk_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp | |||
1133 | mdev->read_cnt = 0; | 1134 | mdev->read_cnt = 0; |
1134 | mdev->writ_cnt = 0; | 1135 | mdev->writ_cnt = 0; |
1135 | 1136 | ||
1136 | drbd_setup_queue_param(mdev, mdev->state.conn == C_CONNECTED && | 1137 | max_seg_s = DRBD_MAX_SEGMENT_SIZE; |
1137 | mdev->agreed_pro_version < 95 ? | 1138 | if (mdev->state.conn == C_CONNECTED) { |
1138 | DRBD_MAX_SIZE_H80_PACKET : DRBD_MAX_SEGMENT_SIZE); | 1139 | /* We are Primary, Connected, and now attach a new local |
1140 | * backing store. We must not increase the user visible maximum | ||
1141 | * bio size on this device to something the peer may not be | ||
1142 | * able to handle. */ | ||
1143 | if (mdev->agreed_pro_version < 94) | ||
1144 | max_seg_s = queue_max_segment_size(mdev->rq_queue); | ||
1145 | else if (mdev->agreed_pro_version == 94) | ||
1146 | max_seg_s = DRBD_MAX_SIZE_H80_PACKET; | ||
1147 | /* else: drbd 8.3.9 and later, stay with default */ | ||
1148 | } | ||
1149 | |||
1150 | drbd_setup_queue_param(mdev, max_seg_s); | ||
1139 | 1151 | ||
1140 | /* If I am currently not R_PRIMARY, | 1152 | /* If I am currently not R_PRIMARY, |
1141 | * but meta data primary indicator is set, | 1153 | * but meta data primary indicator is set, |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 6b69b2f734dc..9da32ac62c22 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -3088,6 +3088,8 @@ static int receive_sizes(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned | |||
3088 | 3088 | ||
3089 | if (mdev->agreed_pro_version < 94) | 3089 | if (mdev->agreed_pro_version < 94) |
3090 | max_seg_s = be32_to_cpu(p->max_segment_size); | 3090 | max_seg_s = be32_to_cpu(p->max_segment_size); |
3091 | else if (mdev->agreed_pro_version == 94) | ||
3092 | max_seg_s = DRBD_MAX_SIZE_H80_PACKET; | ||
3091 | else /* drbd 8.3.8 onwards */ | 3093 | else /* drbd 8.3.8 onwards */ |
3092 | max_seg_s = DRBD_MAX_SEGMENT_SIZE; | 3094 | max_seg_s = DRBD_MAX_SEGMENT_SIZE; |
3093 | 3095 | ||