summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/syncop.c4
-rw-r--r--xlators/cluster/dht/src/dht-common.c4
-rw-r--r--xlators/features/locks/src/common.c1
-rw-r--r--xlators/features/locks/src/posix.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c22
-rw-r--r--xlators/protocol/server/src/server.c5
6 files changed, 10 insertions, 30 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 00a9b576269..7275f22b099 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -831,8 +831,10 @@ syncenv_new (size_t stacksize, int procmin, int procmax)
newenv->procs++;
}
- if (ret != 0)
+ if (ret != 0) {
syncenv_destroy (newenv);
+ newenv = NULL;
+ }
return newenv;
}
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 6a061641fd0..c9889514762 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2474,6 +2474,7 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
dht_layout_t *layout = NULL;
int i = 0;
int call_cnt = 0;
+ int gen = 0;
loc_t new_loc = {0,};
VALIDATE_OR_GOTO (frame, err);
@@ -2548,6 +2549,7 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
"incomplete layout failure for path=%s",
loc->path);
+ gen = layout->gen;
dht_layout_unref (this, local->layout);
local->layout = NULL;
local->cached_subvol = NULL;
@@ -2556,7 +2558,7 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
"Called revalidate lookup for %s, "
"but layout->gen (%d) is less than "
"conf->gen (%d), calling fresh_lookup",
- loc->path, layout->gen, conf->gen);
+ loc->path, gen, conf->gen);
goto do_fresh_lookup;
}
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index 796b538f6f2..8cdff0d61ef 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -480,6 +480,7 @@ new_posix_lock (struct gf_flock *flock, client_t *client, pid_t client_pid,
lock->client_uid = gf_strdup (client->client_uid);
if (lock->client_uid == NULL) {
GF_FREE (lock);
+ lock = NULL;
goto out;
}
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 0e75ad889be..5d79fa16a66 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -2840,6 +2840,7 @@ new_meta_lock (call_frame_t *frame, xlator_t *this)
gf_msg (this->name, GF_LOG_ERROR, 0, ENOMEM, "mem allocation"
" failed for client_uid");
GF_FREE (lock);
+ lock = NULL;
goto out;
}
@@ -3808,7 +3809,8 @@ gf_lkmig_info_to_posix_lock (call_frame_t *frame,
lock->client_uid = gf_strdup (lmi->client_uid);
if (lock->client_uid == NULL) {
GF_FREE (lock);
- goto out;
+ lock = NULL;
+ goto out;
}
lock->client_pid = lmi->flock.l_pid;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 059161470ae..73af41bde96 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -737,28 +737,6 @@ glusterd_check_localoption (char *key)
}
int
-glusterd_check_voloption (char *key)
-{
- char *completion = NULL;
- struct volopt_map_entry *vmep = NULL;
- int ret = 0;
-
- COMPLETE_OPTION(key, completion, ret);
- for (vmep = glusterd_volopt_map; vmep->key; vmep++) {
- if (strcmp (vmep->key, key) == 0) {
- if ((vmep->type == DOC) ||
- (vmep->type == DOC))
- return _gf_true;
- else
- return _gf_false;
- }
- }
-
- return _gf_false;
-
-}
-
-int
glusterd_check_option_exists (char *key, char **completion)
{
struct volopt_map_entry vme = {0,};
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 4739c4560a6..202fe71ba55 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -132,11 +132,6 @@ gfs_serialize_reply (rpcsvc_request_t *req, void *arg, struct iovec *outmsg,
}
outmsg->iov_len = retlen;
ret:
- if (retlen == -1) {
- iobuf_unref (iob);
- iob = NULL;
- }
-
return iob;
}