summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c4
-rw-r--r--xlators/cluster/afr/src/afr.h10
2 files changed, 9 insertions, 5 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); \