diff options
Diffstat (limited to 'net/ceph')
| -rw-r--r-- | net/ceph/messenger.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 994192beda02..cb5b4e6733f0 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
| @@ -2207,10 +2207,18 @@ static int read_partial_message(struct ceph_connection *con) | |||
| 2207 | ret = ceph_con_in_msg_alloc(con, &skip); | 2207 | ret = ceph_con_in_msg_alloc(con, &skip); |
| 2208 | if (ret < 0) | 2208 | if (ret < 0) |
| 2209 | return ret; | 2209 | return ret; |
| 2210 | |||
| 2211 | BUG_ON(!con->in_msg ^ skip); | ||
| 2212 | if (con->in_msg && data_len > con->in_msg->data_length) { | ||
| 2213 | pr_warning("%s skipping long message (%u > %zd)\n", | ||
| 2214 | __func__, data_len, con->in_msg->data_length); | ||
| 2215 | ceph_msg_put(con->in_msg); | ||
| 2216 | con->in_msg = NULL; | ||
| 2217 | skip = 1; | ||
| 2218 | } | ||
| 2210 | if (skip) { | 2219 | if (skip) { |
| 2211 | /* skip this message */ | 2220 | /* skip this message */ |
| 2212 | dout("alloc_msg said skip message\n"); | 2221 | dout("alloc_msg said skip message\n"); |
| 2213 | BUG_ON(con->in_msg); | ||
| 2214 | con->in_base_pos = -front_len - middle_len - data_len - | 2222 | con->in_base_pos = -front_len - middle_len - data_len - |
| 2215 | sizeof(m->footer); | 2223 | sizeof(m->footer); |
| 2216 | con->in_tag = CEPH_MSGR_TAG_READY; | 2224 | con->in_tag = CEPH_MSGR_TAG_READY; |
