diff options
author | Yaniv Kaul <ykaul@redhat.com> | 2019-07-30 10:15:42 +0300 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2019-08-05 03:08:13 +0000 |
commit | 2aeb9fb17087434d87497a85077073ea3bf94869 (patch) | |
tree | 3625e683a27b8719ee97d89702815c89b6c5d2e4 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 2dd43d3e5b5305db3a5ecafabdd9cf8e7775ec75 (diff) |
multiple files: reduce minor work under RCU_READ_LOCK
1. Try to unlock faster - in error paths.
2. Remove memory allocations - do them before the lock.
Change-Id: I1e9ddd80b99de45ad0f557d62a5f28951dfd54c8
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index f8e0bfe1178..da0d8c945e2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1683,17 +1683,21 @@ glusterd_op_stage_sync_volume(dict_t *dict, char **op_errstr) peerinfo = glusterd_peerinfo_find(NULL, hostname); if (peerinfo == NULL) { + RCU_READ_UNLOCK; ret = -1; snprintf(msg, sizeof(msg), "%s, is not a friend", hostname); *op_errstr = gf_strdup(msg); + goto out; } else if (!peerinfo->connected) { + RCU_READ_UNLOCK; + ret = -1; snprintf(msg, sizeof(msg), "%s, is not connected at " "the moment", hostname); *op_errstr = gf_strdup(msg); - ret = -1; + goto out; } RCU_READ_UNLOCK; |