diff options
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 7 | ||||
-rw-r--r-- | include/linux/drbd.h | 7 | ||||
-rw-r--r-- | include/linux/drbd_limits.h | 9 | ||||
-rw-r--r-- | include/linux/drbd_nl.h | 3 |
4 files changed, 26 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 9e27d82a9a19..f969d8717e23 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -1323,6 +1323,8 @@ static int drbd_nl_net_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp, | |||
1323 | new_conf->wire_protocol = DRBD_PROT_C; | 1323 | new_conf->wire_protocol = DRBD_PROT_C; |
1324 | new_conf->ping_timeo = DRBD_PING_TIMEO_DEF; | 1324 | new_conf->ping_timeo = DRBD_PING_TIMEO_DEF; |
1325 | new_conf->rr_conflict = DRBD_RR_CONFLICT_DEF; | 1325 | new_conf->rr_conflict = DRBD_RR_CONFLICT_DEF; |
1326 | new_conf->on_congestion = DRBD_ON_CONGESTION_DEF; | ||
1327 | new_conf->cong_extents = DRBD_CONG_EXTENTS_DEF; | ||
1326 | 1328 | ||
1327 | if (!net_conf_from_tags(mdev, nlp->tag_list, new_conf)) { | 1329 | if (!net_conf_from_tags(mdev, nlp->tag_list, new_conf)) { |
1328 | retcode = ERR_MANDATORY_TAG; | 1330 | retcode = ERR_MANDATORY_TAG; |
@@ -1344,6 +1346,11 @@ static int drbd_nl_net_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp, | |||
1344 | } | 1346 | } |
1345 | } | 1347 | } |
1346 | 1348 | ||
1349 | if (new_conf->on_congestion != OC_BLOCK && new_conf->wire_protocol != DRBD_PROT_A) { | ||
1350 | retcode = ERR_CONG_NOT_PROTO_A; | ||
1351 | goto fail; | ||
1352 | } | ||
1353 | |||
1347 | if (mdev->state.role == R_PRIMARY && new_conf->want_lose) { | 1354 | if (mdev->state.role == R_PRIMARY && new_conf->want_lose) { |
1348 | retcode = ERR_DISCARD; | 1355 | retcode = ERR_DISCARD; |
1349 | goto fail; | 1356 | goto fail; |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index ef44c7a0638c..03a08baabf11 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -96,6 +96,12 @@ enum drbd_on_no_data { | |||
96 | OND_SUSPEND_IO | 96 | OND_SUSPEND_IO |
97 | }; | 97 | }; |
98 | 98 | ||
99 | enum drbd_on_congestion { | ||
100 | OC_BLOCK, | ||
101 | OC_PULL_AHEAD, | ||
102 | OC_DISCONNECT, | ||
103 | }; | ||
104 | |||
99 | /* KEEP the order, do not delete or insert. Only append. */ | 105 | /* KEEP the order, do not delete or insert. Only append. */ |
100 | enum drbd_ret_codes { | 106 | enum drbd_ret_codes { |
101 | ERR_CODE_BASE = 100, | 107 | ERR_CODE_BASE = 100, |
@@ -146,6 +152,7 @@ enum drbd_ret_codes { | |||
146 | ERR_PERM = 152, | 152 | ERR_PERM = 152, |
147 | ERR_NEED_APV_93 = 153, | 153 | ERR_NEED_APV_93 = 153, |
148 | ERR_STONITH_AND_PROT_A = 154, | 154 | ERR_STONITH_AND_PROT_A = 154, |
155 | ERR_CONG_NOT_PROTO_A = 155, | ||
149 | 156 | ||
150 | /* insert new ones above this line */ | 157 | /* insert new ones above this line */ |
151 | AFTER_LAST_ERR_CODE | 158 | AFTER_LAST_ERR_CODE |
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index 4ac33f34b77e..abf418724e52 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h | |||
@@ -129,6 +129,7 @@ | |||
129 | #define DRBD_AFTER_SB_2P_DEF ASB_DISCONNECT | 129 | #define DRBD_AFTER_SB_2P_DEF ASB_DISCONNECT |
130 | #define DRBD_RR_CONFLICT_DEF ASB_DISCONNECT | 130 | #define DRBD_RR_CONFLICT_DEF ASB_DISCONNECT |
131 | #define DRBD_ON_NO_DATA_DEF OND_IO_ERROR | 131 | #define DRBD_ON_NO_DATA_DEF OND_IO_ERROR |
132 | #define DRBD_ON_CONGESTION_DEF OC_BLOCK | ||
132 | 133 | ||
133 | #define DRBD_MAX_BIO_BVECS_MIN 0 | 134 | #define DRBD_MAX_BIO_BVECS_MIN 0 |
134 | #define DRBD_MAX_BIO_BVECS_MAX 128 | 135 | #define DRBD_MAX_BIO_BVECS_MAX 128 |
@@ -154,5 +155,13 @@ | |||
154 | #define DRBD_C_MIN_RATE_MAX (4 << 20) | 155 | #define DRBD_C_MIN_RATE_MAX (4 << 20) |
155 | #define DRBD_C_MIN_RATE_DEF 4096 | 156 | #define DRBD_C_MIN_RATE_DEF 4096 |
156 | 157 | ||
158 | #define DRBD_CONG_FILL_MIN 0 | ||
159 | #define DRBD_CONG_FILL_MAX (10<<21) /* 10GByte in sectors */ | ||
160 | #define DRBD_CONG_FILL_DEF 0 | ||
161 | |||
162 | #define DRBD_CONG_EXTENTS_MIN DRBD_AL_EXTENTS_MIN | ||
163 | #define DRBD_CONG_EXTENTS_MAX DRBD_AL_EXTENTS_MAX | ||
164 | #define DRBD_CONG_EXTENTS_DEF DRBD_AL_EXTENTS_DEF | ||
165 | |||
157 | #undef RANGE | 166 | #undef RANGE |
158 | #endif | 167 | #endif |
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h index ade91107c9a5..8cde3945d1f7 100644 --- a/include/linux/drbd_nl.h +++ b/include/linux/drbd_nl.h | |||
@@ -56,6 +56,9 @@ NL_PACKET(net_conf, 5, | |||
56 | NL_INTEGER( 39, T_MAY_IGNORE, rr_conflict) | 56 | NL_INTEGER( 39, T_MAY_IGNORE, rr_conflict) |
57 | NL_INTEGER( 40, T_MAY_IGNORE, ping_timeo) | 57 | NL_INTEGER( 40, T_MAY_IGNORE, ping_timeo) |
58 | NL_INTEGER( 67, T_MAY_IGNORE, rcvbuf_size) | 58 | NL_INTEGER( 67, T_MAY_IGNORE, rcvbuf_size) |
59 | NL_INTEGER( 81, T_MAY_IGNORE, on_congestion) | ||
60 | NL_INTEGER( 82, T_MAY_IGNORE, cong_fill) | ||
61 | NL_INTEGER( 83, T_MAY_IGNORE, cong_extents) | ||
59 | /* 59 addr_family was available in GIT, never released */ | 62 | /* 59 addr_family was available in GIT, never released */ |
60 | NL_BIT( 60, T_MANDATORY, mind_af) | 63 | NL_BIT( 60, T_MANDATORY, mind_af) |
61 | NL_BIT( 27, T_MAY_IGNORE, want_lose) | 64 | NL_BIT( 27, T_MAY_IGNORE, want_lose) |