diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2017-06-15 16:30:54 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-07-07 17:25:15 +0200 |
commit | 98ad5ebd1505eb903ae8bc27e94c1ab0d1c3e651 (patch) | |
tree | cc2081e0f97f2f332d330e0d34349a8632a5922c /net | |
parent | 2e59ffd1df4aba5289f04d362efc8432fac14949 (diff) | |
download | linux-98ad5ebd1505eb903ae8bc27e94c1ab0d1c3e651.tar.bz2 |
libceph: ceph_connection_operations::reencode_message() method
Give upper layers a chance to reencode the message after the connection
is negotiated and ->peer_features is set. OSD client will use this to
support both luminous and pre-luminous OSDs (in a single cluster): the
former need MOSDOp v8; the latter will continue to be sent MOSDOp v4.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/messenger.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 9daed2540639..0c31035bbfee 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1288,13 +1288,16 @@ static void prepare_write_message(struct ceph_connection *con) m->hdr.seq = cpu_to_le64(++con->out_seq); m->needs_out_seq = false; } - WARN_ON(m->data_length != le32_to_cpu(m->hdr.data_len)); + + if (con->ops->reencode_message) + con->ops->reencode_message(m); dout("prepare_write_message %p seq %lld type %d len %d+%d+%zd\n", m, con->out_seq, le16_to_cpu(m->hdr.type), le32_to_cpu(m->hdr.front_len), le32_to_cpu(m->hdr.middle_len), m->data_length); - BUG_ON(le32_to_cpu(m->hdr.front_len) != m->front.iov_len); + WARN_ON(m->front.iov_len != le32_to_cpu(m->hdr.front_len)); + WARN_ON(m->data_length != le32_to_cpu(m->hdr.data_len)); /* tag + hdr + front + middle */ con_out_kvec_add(con, sizeof (tag_msg), &tag_msg); |