summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c4
-rw-r--r--xlators/cluster/afr/src/afr.h10
-rw-r--r--xlators/cluster/dht/src/dht-common.c4
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c2
-rw-r--r--xlators/cluster/stripe/src/stripe.c13
5 files changed, 19 insertions, 14 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 600991d5058..c6ce7dc5f39 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1508,6 +1508,8 @@ afr_sh_remove_entry_cbk (call_frame_t *frame, xlator_t *this, int child,
afr_self_heal_t *sh = NULL;
local = frame->local;
+ GF_ASSERT (local);
+
sh = &local->self_heal;
GF_ASSERT (sh->post_remove_call);
@@ -1567,7 +1569,7 @@ afr_sh_call_entry_expunge_remove (call_frame_t *frame, xlator_t *this,
return;
out:
gf_log (this->name, GF_LOG_ERROR, "Expunge of %s failed, reason: %s",
- local->loc.path, strerror (op_errno));
+ local ? local->loc.path : "<unknown>" , strerror (op_errno));
expunge_done (frame, this, child_index, -1, op_errno);
}
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 978339017a2..84e8907f993 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -892,10 +892,12 @@ afr_launch_openfd_self_heal (call_frame_t *frame, xlator_t *this, fd_t *fd);
do { \
afr_local_t *__local = NULL; \
xlator_t *__this = NULL; \
- __local = frame->local; \
- __this = frame->this; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
+ if (frame) { \
+ __local = frame->local; \
+ __this = frame->this; \
+ frame->local = NULL; \
+ STACK_DESTROY (frame->root); \
+ } \
if (__local) { \
afr_local_cleanup (__local, __this); \
mem_put (__local); \
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 29bfd21606b..0234bbbd409 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2062,10 +2062,8 @@ dht_getxattr_get_real_filename_cbk (call_frame_t *frame, void *cookie,
{
int this_call_cnt = 0;
dht_local_t *local = NULL;
- dht_conf_t *conf = NULL;
- conf = this->private;
local = frame->local;
if (op_ret != -1) {
@@ -2092,7 +2090,6 @@ int
dht_getxattr_get_real_filename (call_frame_t *frame, xlator_t *this,
loc_t *loc, const char *key, dict_t *xdata)
{
- dht_conf_t *conf = NULL;
dht_local_t *local = NULL;
int i = 0;
dht_layout_t *layout = NULL;
@@ -2100,7 +2097,6 @@ dht_getxattr_get_real_filename (call_frame_t *frame, xlator_t *this,
xlator_t *subvol = NULL;
- conf = this->private;
local = frame->local;
layout = local->layout;
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index d212f6eae25..c181bebd131 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -1571,7 +1571,7 @@ out:
{
status = dict_new ();
gf_defrag_status_get (defrag, status);
- if (ctx->notify)
+ if (ctx && ctx->notify)
ctx->notify (GF_EN_DEFRAG_STATUS, status);
if (status)
dict_unref (status);
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index b3e87d31b5a..bdea45f3ed6 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -4402,10 +4402,15 @@ unlock:
out:
if (!count) {
/* all entries are directories */
- frame->local = NULL;
- STRIPE_STACK_UNWIND (readdir, frame, local->op_ret,
- local->op_errno, &local->entries, NULL);
- gf_dirent_free (&local->entries);
+ if (frame)
+ frame->local = NULL;
+ STRIPE_STACK_UNWIND (readdir, frame,
+ local ? local->op_ret : -1,
+ local ? local->op_errno : EINVAL,
+ local ? &local->entries : NULL,
+ NULL);
+ if (local)
+ gf_dirent_free (&local->entries);
stripe_local_wipe (local);
mem_put (local);
}