|
|
d1681e |
From f6b4b4308b838b29f17b2a4a54385269991f0118 Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Mohit Agrawal <moagrawal@redhat.com>
|
|
|
d1681e |
Date: Thu, 5 Jul 2018 15:02:06 +0530
|
|
|
d1681e |
Subject: [PATCH 315/325] changelog: fix br-state-check.t crash for brick_mux
|
|
|
d1681e |
|
|
|
d1681e |
Problem: br-state-check.t is getting crash
|
|
|
d1681e |
|
|
|
d1681e |
Solution: Check condition in rpcsvc_request_create
|
|
|
d1681e |
before allocate memory from rxpool
|
|
|
d1681e |
|
|
|
d1681e |
> BUG: 1597776
|
|
|
d1681e |
> Change-Id: I4fde1ade6073f603c32453f1840395db9a9155b7
|
|
|
d1681e |
> fixes: bz#1597776
|
|
|
d1681e |
> (cherry picked from commit e31c7a7c0c1ea3f6e931935226fb976a92779ba7)
|
|
|
d1681e |
> (Reviewed on upstream link https://review.gluster.org/#/c/20132/)
|
|
|
d1681e |
|
|
|
d1681e |
BUG: 1597768
|
|
|
d1681e |
Change-Id: I3a0dc8f9625a6ab9ce8364119413ae45e321e620
|
|
|
d1681e |
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/143719
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
rpc/rpc-lib/src/rpcsvc.c | 5 +++--
|
|
|
d1681e |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
|
|
|
d1681e |
index 3acaa8b..8d0c409 100644
|
|
|
d1681e |
--- a/rpc/rpc-lib/src/rpcsvc.c
|
|
|
d1681e |
+++ b/rpc/rpc-lib/src/rpcsvc.c
|
|
|
d1681e |
@@ -447,7 +447,7 @@ rpcsvc_request_create (rpcsvc_t *svc, rpc_transport_t *trans,
|
|
|
d1681e |
size_t msglen = 0;
|
|
|
d1681e |
int ret = -1;
|
|
|
d1681e |
|
|
|
d1681e |
- if (!svc || !trans)
|
|
|
d1681e |
+ if (!svc || !trans || !svc->rxpool)
|
|
|
d1681e |
return NULL;
|
|
|
d1681e |
|
|
|
d1681e |
/* We need to allocate the request before actually calling
|
|
|
d1681e |
@@ -1473,6 +1473,7 @@ rpcsvc_get_listener (rpcsvc_t *svc, uint16_t port, rpc_transport_t *trans)
|
|
|
d1681e |
{
|
|
|
d1681e |
rpcsvc_listener_t *listener = NULL;
|
|
|
d1681e |
char found = 0;
|
|
|
d1681e |
+ rpcsvc_listener_t *next = NULL;
|
|
|
d1681e |
uint32_t listener_port = 0;
|
|
|
d1681e |
|
|
|
d1681e |
if (!svc) {
|
|
|
d1681e |
@@ -1481,7 +1482,7 @@ rpcsvc_get_listener (rpcsvc_t *svc, uint16_t port, rpc_transport_t *trans)
|
|
|
d1681e |
|
|
|
d1681e |
pthread_mutex_lock (&svc->rpclock);
|
|
|
d1681e |
{
|
|
|
d1681e |
- list_for_each_entry (listener, &svc->listeners, list) {
|
|
|
d1681e |
+ list_for_each_entry_safe (listener, next, &svc->listeners, list) {
|
|
|
d1681e |
if (listener && trans) {
|
|
|
d1681e |
if (listener->trans == trans) {
|
|
|
d1681e |
found = 1;
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|