提交 85efc72a 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client

Pull last minute Ceph fixes from Sage Weil:
 "The important one fixes a bug in the socket failure handling behavior
  that was turned up in some recent failure injection testing.  The
  other two are minor bug fixes."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  rbd: endian bug in rbd_req_cb()
  rbd: Fix ceph_snap_context size calculation
  libceph: fix messenger retry
...@@ -499,7 +499,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header, ...@@ -499,7 +499,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
/ sizeof (*ondisk)) / sizeof (*ondisk))
return -EINVAL; return -EINVAL;
header->snapc = kmalloc(sizeof(struct ceph_snap_context) + header->snapc = kmalloc(sizeof(struct ceph_snap_context) +
snap_count * sizeof (*ondisk), snap_count * sizeof(u64),
gfp_flags); gfp_flags);
if (!header->snapc) if (!header->snapc)
return -ENOMEM; return -ENOMEM;
...@@ -977,7 +977,7 @@ static void rbd_req_cb(struct ceph_osd_request *req, struct ceph_msg *msg) ...@@ -977,7 +977,7 @@ static void rbd_req_cb(struct ceph_osd_request *req, struct ceph_msg *msg)
op = (void *)(replyhead + 1); op = (void *)(replyhead + 1);
rc = le32_to_cpu(replyhead->result); rc = le32_to_cpu(replyhead->result);
bytes = le64_to_cpu(op->extent.length); bytes = le64_to_cpu(op->extent.length);
read_op = (le32_to_cpu(op->op) == CEPH_OSD_OP_READ); read_op = (le16_to_cpu(op->op) == CEPH_OSD_OP_READ);
dout("rbd_req_cb bytes=%lld readop=%d rc=%d\n", bytes, read_op, rc); dout("rbd_req_cb bytes=%lld readop=%d rc=%d\n", bytes, read_op, rc);
......
...@@ -163,16 +163,8 @@ struct ceph_connection { ...@@ -163,16 +163,8 @@ struct ceph_connection {
/* connection negotiation temps */ /* connection negotiation temps */
char in_banner[CEPH_BANNER_MAX_LEN]; char in_banner[CEPH_BANNER_MAX_LEN];
union { struct ceph_msg_connect out_connect;
struct { /* outgoing connection */ struct ceph_msg_connect_reply in_reply;
struct ceph_msg_connect out_connect;
struct ceph_msg_connect_reply in_reply;
};
struct { /* incoming */
struct ceph_msg_connect in_connect;
struct ceph_msg_connect_reply out_reply;
};
};
struct ceph_entity_addr actual_peer_addr; struct ceph_entity_addr actual_peer_addr;
/* message out temps */ /* message out temps */
......
...@@ -1423,7 +1423,7 @@ static int process_connect(struct ceph_connection *con) ...@@ -1423,7 +1423,7 @@ static int process_connect(struct ceph_connection *con)
* dropped messages. * dropped messages.
*/ */
dout("process_connect got RESET peer seq %u\n", dout("process_connect got RESET peer seq %u\n",
le32_to_cpu(con->in_connect.connect_seq)); le32_to_cpu(con->in_reply.connect_seq));
pr_err("%s%lld %s connection reset\n", pr_err("%s%lld %s connection reset\n",
ENTITY_NAME(con->peer_name), ENTITY_NAME(con->peer_name),
ceph_pr_addr(&con->peer_addr.in_addr)); ceph_pr_addr(&con->peer_addr.in_addr));
...@@ -1450,10 +1450,10 @@ static int process_connect(struct ceph_connection *con) ...@@ -1450,10 +1450,10 @@ static int process_connect(struct ceph_connection *con)
* If we sent a smaller connect_seq than the peer has, try * If we sent a smaller connect_seq than the peer has, try
* again with a larger value. * again with a larger value.
*/ */
dout("process_connect got RETRY my seq = %u, peer_seq = %u\n", dout("process_connect got RETRY_SESSION my seq %u, peer %u\n",
le32_to_cpu(con->out_connect.connect_seq), le32_to_cpu(con->out_connect.connect_seq),
le32_to_cpu(con->in_connect.connect_seq)); le32_to_cpu(con->in_reply.connect_seq));
con->connect_seq = le32_to_cpu(con->in_connect.connect_seq); con->connect_seq = le32_to_cpu(con->in_reply.connect_seq);
ceph_con_out_kvec_reset(con); ceph_con_out_kvec_reset(con);
ret = prepare_write_connect(con); ret = prepare_write_connect(con);
if (ret < 0) if (ret < 0)
...@@ -1468,9 +1468,9 @@ static int process_connect(struct ceph_connection *con) ...@@ -1468,9 +1468,9 @@ static int process_connect(struct ceph_connection *con)
*/ */
dout("process_connect got RETRY_GLOBAL my %u peer_gseq %u\n", dout("process_connect got RETRY_GLOBAL my %u peer_gseq %u\n",
con->peer_global_seq, con->peer_global_seq,
le32_to_cpu(con->in_connect.global_seq)); le32_to_cpu(con->in_reply.global_seq));
get_global_seq(con->msgr, get_global_seq(con->msgr,
le32_to_cpu(con->in_connect.global_seq)); le32_to_cpu(con->in_reply.global_seq));
ceph_con_out_kvec_reset(con); ceph_con_out_kvec_reset(con);
ret = prepare_write_connect(con); ret = prepare_write_connect(con);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册