diff options
Diffstat (limited to 'rpc/rpc-transport/socket/src/socket.c')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 12 |
1 files changed, 12 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: |