From 036dcd39bfa40473073d45c10a0daec63fbca2ab Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Wed, 4 May 2016 20:16:36 +0530 Subject: cluster/dht: Perform NULL check on xdata before dict_get() Backport of: http://review.gluster.org/14212 .. to prevent unnecessary logs from gf_msg_callingfn() Change-Id: Ic2f21532f09af3ab7d36ce5f20c561fff5208fbb BUG: 1333244 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/14218 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Niels de Vos --- xlators/cluster/dht/src/dht-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 01b6123d1b3..4f006b97919 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -7206,7 +7206,7 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie, if (op_ret == -1) { local->op_errno = op_errno; - parent_layout_changed = dict_get (xdata, GF_PREOP_CHECK_FAILED) + parent_layout_changed = (xdata && dict_get (xdata, GF_PREOP_CHECK_FAILED)) ? 1 : 0; if (parent_layout_changed) { gf_msg (this->name, GF_LOG_INFO, 0, -- cgit