From: Sage Weil Date: Tue, 8 Sep 2009 20:52:34 +0000 (-0700) Subject: kclient: kill msgr WAIT X-Git-Tag: v0.14~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f65caf763ab8636fa65edebe6a392bcd2152e68;p=ceph.git kclient: kill msgr WAIT --- diff --git a/src/kernel/messenger.c b/src/kernel/messenger.c index 2a30c02fb42..b7f2bea7903 100644 --- a/src/kernel/messenger.c +++ b/src/kernel/messenger.c @@ -854,18 +854,6 @@ static int process_connect(struct ceph_connection *con) prepare_read_connect(con); break; - case CEPH_MSGR_TAG_WAIT: - /* - * If there is a connection race (we are opening connections to - * each other), one of us may just have to WAIT. We will keep - * our queued messages, in expectation of being replaced by an - * incoming connection. - */ - dout("process_connect peer connecting WAIT\n"); - set_bit(WAIT, &con->state); - con_close_socket(con); - break; - case CEPH_MSGR_TAG_READY: clear_bit(CONNECTING, &con->state); if (con->in_reply.flags & CEPH_MSG_CONNECT_LOSSY) @@ -883,6 +871,15 @@ static int process_connect(struct ceph_connection *con) prepare_read_tag(con); break; + case CEPH_MSGR_TAG_WAIT: + /* + * If there is a connection race (we are opening + * connections to each other), one of us may just have + * to WAIT. This shouldn't happen if we are the + * client. + */ + pr_err("process_connect peer connecting WAIT\n"); + default: pr_err("ceph connect protocol error, will retry\n"); con->error_msg = "protocol error, garbage tag during connect"; @@ -1305,7 +1302,7 @@ more: ret = read_partial_connect(con); if (ret <= 0) goto done; - if (process_connect(con) < 0 || test_bit(WAIT, &con->state)) { + if (process_connect(con) < 0) { ret = -1; goto out; } @@ -1412,9 +1409,8 @@ bad_tag: */ static void queue_con(struct ceph_connection *con) { - if (test_bit(WAIT, &con->state) || - test_bit(DEAD, &con->state)) { - dout("queue_con %p ignoring: WAIT|DEAD\n", + if (test_bit(DEAD, &con->state)) { + dout("queue_con %p ignoring: DEAD\n", con); return; } @@ -1461,10 +1457,6 @@ more: dout("con_work OPENING\n"); con_close_socket(con); } - if (test_bit(WAIT, &con->state)) { /* we are a zombie */ - dout("con_work WAIT\n"); - goto done; - } if (test_and_clear_bit(SOCK_CLOSED, &con->state) || try_read(con) < 0 || diff --git a/src/kernel/messenger.h b/src/kernel/messenger.h index 8e94bbafe6f..ed675f5d9a8 100644 --- a/src/kernel/messenger.h +++ b/src/kernel/messenger.h @@ -131,8 +131,6 @@ struct ceph_msg_pos { #define STANDBY 8 /* no outgoing messages, socket closed. we keep * the ceph_connection around to maintain shared * state with the peer. */ -#define WAIT 9 /* waiting for peer to connect to us (during a - * connection race) */ #define CLOSED 10 /* we've closed the connection */ #define SOCK_CLOSED 11 /* socket state changed to closed */ #define REGISTERED 12 /* connection appears in con_tree */