diff options
Diffstat (limited to 'rpc/rpc-transport')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 12 | ||||
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 0a3a5812a91..a7e2bb0cfdf 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -1904,6 +1904,7 @@ __socket_read_reply (rpc_transport_t *this) /* release priv->lock, so as to avoid deadlock b/w conn->lock * and priv->lock, since we are doing an upcall here. */ + frag->state = SP_STATE_NOTIFYING_XID; pthread_mutex_unlock (&priv->lock); { ret = rpc_transport_notify (this, @@ -1912,6 +1913,9 @@ __socket_read_reply (rpc_transport_t *this) } pthread_mutex_lock (&priv->lock); + /* Transition back to externally visible state. */ + frag->state = SP_STATE_READ_MSGTYPE; + if (ret == -1) { gf_log (this->name, GF_LOG_WARNING, "notify for event MAP_XID failed for %s", @@ -1999,6 +2003,14 @@ __socket_read_frag (rpc_transport_t *this) } break; + + case SP_STATE_NOTIFYING_XID: + /* Another epoll thread is notifying higher layers + *of reply's xid. */ + errno = EAGAIN; + return -1; + break; + } out: diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h index 33c936938eb..6a8ab870ab7 100644 --- a/rpc/rpc-transport/socket/src/socket.h +++ b/rpc/rpc-transport/socket/src/socket.h @@ -59,6 +59,7 @@ typedef enum { SP_STATE_RPCFRAG_INIT, SP_STATE_READING_MSGTYPE, SP_STATE_READ_MSGTYPE, + SP_STATE_NOTIFYING_XID } sp_rpcfrag_state_t; typedef enum { |